library(readr)
library(dplyr)
library(metafor)
library(devtools)
library(purrr)
library(tidyverse)
library(tidyr)
library(tibble)
library(kableExtra)
library(robumeta)
library(ggpubr)
library(ggplot2)
library(here)
Functions for preparing the data for meta analyses
data_subset_parameterid_individual_by_age <- function(mydata, parameter, age_min=0, age_center=100) {
tmp <- mydata %>%
filter(
age_in_days >= age_min,
id == parameter
) %>%
# take results for single individual closest to age_center
mutate(age_diff = abs(age_center - age_in_days)) %>%
group_by(biological_sample_id) %>%
filter(age_diff == min(age_diff)) %>%
select(-age_diff)# %>%
# filter(!duplicated(biological_sample_id))
# still some individuals with multiple records (because same individual appear under different procedures, so filter to one record)
j <- match(unique(tmp$biological_sample_id), tmp$biological_sample_id)
tmp[j, ]
}
calculate_population_stats <- function(mydata, min_individuals = 5) {
mydata %>%
group_by(population, strain_name, production_center, sex) %>%
summarise(
trait = parameter_name[1],
x_bar = mean(data_point),
x_sd = sd(data_point),
n_ind = n()
) %>%
ungroup() %>%
filter(n_ind > min_individuals) %>%
# Check both sexes present & filter those missing
group_by(population) %>%
mutate(
n_sex = n_distinct(sex)
) %>%
ungroup() %>%
filter(n_sex == 2) %>%
select(-n_sex) %>%
arrange(production_center, strain_name, population, sex)
}
create_meta_analysis_effect_sizes <- function(mydata) {
i <- seq(1, nrow(mydata), by = 2)
input <- data.frame(
n1i = mydata$n_ind[i],
n2i = mydata$n_ind[i + 1],
x1i = mydata$x_bar[i],
x2i = mydata$x_bar[i + 1],
sd1i = mydata$x_sd[i],
sd2i = mydata$x_sd[i + 1]
)
mydata[i, ] %>%
select(strain_name, production_center, trait) %>%
mutate(
effect_size_CVR = calculate_lnCVR(CMean = input$x1i, CSD = input$sd1i, CN = input$n1i, EMean = input$x2i, ESD = input$sd2i, EN = input$n2i),
sample_variance_CVR = calculate_var_lnCVR(CMean = input$x1i, CSD = input$sd1i, CN = input$n1i, EMean = input$x2i, ESD = input$sd2i, EN = input$n2i),
effect_size_VR = calculate_lnVR(CSD = input$sd1i, CN = input$n1i, ESD = input$sd2i, EN = input$n2i),
sample_variance_VR = calculate_var_lnVR(CN = input$n1i, EN = input$n2i),
effect_size_RR = calculate_lnRR(CMean = input$x1i, CSD = input$sd1i, CN = input$n1i, EMean = input$x2i, ESD = input$sd2i, EN = input$n2i),
sample_variance_RR = calculate_var_lnRR(CMean = input$x1i, CSD = input$sd1i, CN = input$n1i, EMean = input$x2i, ESD = input$sd2i, EN = input$n2i),
err = as.factor(seq_len(n()))
)
}
Based on function created by A M Senior @ the University of Otago NZ 03/01/2014:
calculate_lnCVR <- function(CMean, CSD, CN, EMean, ESD, EN) {
log(ESD) - log(EMean) + 1 / (2 * (EN - 1)) - (log(CSD) - log(CMean) + 1 / (2 * (CN - 1)))
}
calculate_var_lnCVR <- function(CMean, CSD, CN, EMean, ESD, EN, Equal_E_C_Corr = T) {
if (Equal_E_C_Corr == T) {
mvcorr <- 0 # cor.test(log(c(CMean, EMean)), log(c(CSD, ESD)))$estimate old, slightly incorrect
S2 <- CSD^2 / (CN * (CMean^2)) + 1 / (2 * (CN - 1)) - 2 * mvcorr * sqrt((CSD^2 / (CN * (CMean^2))) * (1 / (2 * (CN - 1)))) + ESD^2 / (EN * (EMean^2)) + 1 / (2 * (EN - 1)) - 2 * mvcorr * sqrt((ESD^2 / (EN * (EMean^2))) * (1 / (2 * (EN - 1))))
}
else {
Cmvcorr <- cor.test(log(CMean), log(CSD))$estimate
Emvcorr <- cor.test(log(EMean), (ESD))$estimate
S2 <- CSD^2 / (CN * (CMean^2)) + 1 / (2 * (CN - 1)) - 2 * Cmvcorr * sqrt((CSD^2 / (CN * (CMean^2))) * (1 / (2 * (CN - 1)))) + ESD^2 / (EN * (EMean^2)) + 1 / (2 * (EN - 1)) - 2 * Emvcorr * sqrt((ESD^2 / (EN * (EMean^2))) * (1 / (2 * (EN - 1))))
}
S2
}
calculate_lnVR <- function(CSD, CN, ESD, EN) {
log(ESD) - log(CSD) + 1 / (2 * (EN - 1)) - 1 / (2 * (CN - 1))
}
calculate_var_lnVR <- function(CN, EN) {
1 / (2 * (EN - 1)) + 1 / (2 * (CN - 1))
}
calculate_lnRR <- function(CMean, CSD, CN, EMean, ESD, EN) {
log(EMean) - log(CMean)
}
calculate_var_lnRR <- function(CMean, CSD, CN, EMean, ESD, EN) {
CSD^2 / (CN * CMean^2) + ESD^2 / (EN * EMean^2)
}
This step we have already done and provide a cleaned up file which is less computing intensive and which we have saved in a folder called export
. However, the cvs is provided in case this is preferred to be attempted, following the steps below:
# loads the raw data, setting some default types for various columns
load_raw <- function(filename) {
read_csv(filename,
col_types = cols(
.default = col_character(),
project_id = col_character(),
id = col_character(),
parameter_id = col_character(),
age_in_days = col_integer(),
date_of_experiment = col_datetime(format = ""),
weight = col_double(),
phenotyping_center_id = col_character(),
production_center_id = col_character(),
weight_date = col_datetime(format = ""),
date_of_birth = col_datetime(format = ""),
procedure_id = col_character(),
pipeline_id = col_character(),
biological_sample_id = col_character(),
biological_model_id = col_character(),
weight_days_old = col_integer(),
datasource_id = col_character(),
experiment_id = col_character(),
data_point = col_double(),
age_in_weeks = col_integer(),
`_version_` = col_character()
)
)
}
# Apply some standard cleaning to the data
clean_raw_data <- function(mydata) {
group <- read_csv(here("data", "ParameterGrouping.csv"))
tmp <-
mydata %>%
# Filter to IMPC source (recommend by Jeremey in email to Susi on 20 Aug 2018)
filter(datasource_name == "IMPC") %>%
# standardise trait names
mutate(parameter_name = tolower(parameter_name)) %>%
# remove extreme ages
filter(age_in_days > 0 & age_in_days < 500) %>%
# remove NAs
filter(!is.na(data_point)) %>%
# subset to reasonable set of variables, date_of_experiment used as an indicator of batch-level effects
select(production_center, strain_name, strain_accession_id, biological_sample_id, pipeline_stable_id, procedure_group, procedure_name, sex, date_of_experiment, age_in_days, weight, parameter_name, data_point) %>%
# sort
arrange(production_center, biological_sample_id, age_in_days)
# filter to groups with > 1 centre
merge(tmp,
tmp %>% group_by(parameter_name) %>%
summarise(center_per_trait = length(unique(production_center, na.rm = TRUE)))
)%>%
filter(center_per_trait >= 2) %>%
# Define population variable
mutate(population = sprintf("%s-%s", production_center, strain_name)) %>%
# add grouping variable: these were decided based on functional groups and procedures
mutate(parameter_group = group$parameter[match(parameter_name, group$parameter_name)] ) %>%
# Assign unique IDs (per trait)
# each unique parameter_name (=trait,use trait variable) gets a unique number ('id')
# We add a new variable, where redundant traits are combined
#[note however, at this stage the dataset still contains nonsensical traits, i.e. traits that may not contain any information on variance]
mutate(id = match(parameter_name, unique(parameter_name))) %>%
as_tibble()
}
# Load raw data - save cleaned dataset as RDS for reuse
data_raw <- load_raw(here("data","dr7.0_all_control_data.csv.gz"))
dir.create("export", F, F)
data <- data_raw %>%
clean_raw_data()
saveRDS(data, "export/data_clean.rds")
For analysis we load the RDS created above and other datasets:
data <- readRDS(here("export", "data_clean.rds"))
procedures <- read_csv(here("data", "procedures.csv"))
Parsed with column specification:
cols(
procedure = [31mcol_character()[39m,
GroupingTerm = [31mcol_character()[39m
)
Checking length of different variables and sample sizes.
This table summarises the available numbers of male and female mice from each strain and originating institution.
length(unique(data$parameter_name)) # 232 traits
[1] 232
length(unique(data$parameter_group)) # 161 parameter groups
[1] 161
length(unique(data$procedure_name)) # 26 procedure groups
[1] 26
length(unique(data$biological_sample_id)) # 27147 individial mice
[1] 27147
#number of males and females per strain per production center
kable(cbind(data %>% group_by(production_center, strain_name) %>% count(biological_sample_id, sex) %>% count(sex) %>% print(n = Inf))) %>%
kable_styling() %>%
scroll_box(width = "60%", height = "200px")
production_center | strain_name | sex | n |
---|---|---|---|
BCM | C57BL/6N | female | 653 |
BCM | C57BL/6N | male | 639 |
BCM | C57BL/6N;C57BL/6NTac | female | 47 |
BCM | C57BL/6N;C57BL/6NTac | male | 52 |
BCM | C57BL/6NCrl | female | 4 |
BCM | C57BL/6NCrl | male | 2 |
BCM | C57BL/6NJ | female | 6 |
BCM | C57BL/6NJ | male | 6 |
BCM | C57BL/6NTac | female | 1 |
BCM | C57BL/6NTac | male | 5 |
HMGU | C57BL/6NCrl | female | 313 |
HMGU | C57BL/6NCrl | male | 311 |
HMGU | C57BL/6NTac | female | 1045 |
HMGU | C57BL/6NTac | male | 1062 |
ICS | C57BL/6N | female | 1025 |
ICS | C57BL/6N | male | 1050 |
JAX | C57BL/6NJ | female | 2025 |
JAX | C57BL/6NJ | male | 2022 |
KMPC | C57BL/6N;C57BL/6NTac | female | 271 |
KMPC | C57BL/6N;C57BL/6NTac | male | 266 |
MARC | C57BL/6N | female | 936 |
MARC | C57BL/6N | male | 926 |
MRC Harwell | C57BL/6NTac | female | 2639 |
MRC Harwell | C57BL/6NTac | male | 2661 |
MRC Harwell | C57BL/6NTac | no_data | 3 |
RBRC | C57BL/6NJcl | female | 222 |
RBRC | C57BL/6NJcl | male | 222 |
RBRC | C57BL/6NTac | female | 526 |
RBRC | C57BL/6NTac | male | 523 |
TCP | C57BL/6NCrl | female | 552 |
TCP | C57BL/6NCrl | male | 524 |
TCP | C57BL6/NCrl | female | 2 |
TCP | C57BL6/NCrl | male | 2 |
UC Davis | C57BL/6N | male | 1 |
UC Davis | C57BL/6NCrl | female | 1155 |
UC Davis | C57BL/6NCrl | male | 1158 |
WTSI | B6Brd;B6Dnk;B6N-Tyr<c-Brd> | female | 97 |
WTSI | B6Brd;B6Dnk;B6N-Tyr<c-Brd> | male | 87 |
WTSI | C57BL/6J-Tyr<c-Brd> or C57BL/6NTac/USA | male | 3 |
WTSI | C57BL/6N | female | 1951 |
WTSI | C57BL/6N | male | 2008 |
WTSI | C57BL/6N;C57BL/6NTac | female | 41 |
WTSI | C57BL/6N;C57BL/6NTac | male | 7 |
WTSI | C57BL/6NCrl | male | 13 |
WTSI | C57BL/6NTac | female | 49 |
WTSI | C57BL/6NTac | male | 34 |
(Step C, Figure 3 in main document)
(n <- length(unique(data$id)))
[1] 232
# Create dataframe to store results
results_alltraits_grouping <-
tibble(id = 1:n, lnCVR=0, lnCVR_lower=0, lnCVR_upper=0,
lnCVR_se=0, lnVR=0, lnVR_lower=0, lnVR_upper=0,
lnVR_se=0, lnRR=0, lnRR_lower=0, lnRR_upper=0, lnRR_se=0, sampleSize=0, trait=0)
for (t in 1:n) {
tryCatch(
{
results <- data %>%
data_subset_parameterid_individual_by_age(t) %>%
calculate_population_stats() %>%
create_meta_analysis_effect_sizes()
# lnCVR, log repsonse-ratio of the coefficient of variance
cvr <- metafor::rma.mv(yi = effect_size_CVR, V = sample_variance_CVR,
random = list(~ 1 | strain_name, ~ 1 | production_center, ~ 1 | err),
control = list(optimizer = "optim", optmethod = "Nelder-Mead",
maxit = 1000), verbose = F, data = results)
# lnVR, comparison of standard deviations
cv <- metafor::rma.mv(yi = effect_size_VR, V = sample_variance_VR,
random = list(~ 1 | strain_name, ~ 1 | production_center, ~ 1 | err),
control = list(optimizer = "optim", optmethod = "Nelder-Mead",
maxit = 1000), verbose = F, data = results)
# for means, lnRR
means <- metafor::rma.mv(yi = effect_size_RR, V = sample_variance_RR,
random = list(~ 1 | strain_name, ~ 1 | production_center, ~ 1 | err),
control = list(optimizer = "optim", optmethod = "Nelder-Mead",
maxit = 1000), verbose = F, data = results)
f <- function(x) unlist(x[c("b", "ci.lb", "ci.ub", "se")])
results_alltraits_grouping[t, 2:14] <- c(f(cvr), f(cv), f(means), means$k)
results_alltraits_grouping[t, 15] <- unique(results$trait)
},
error = function(e) {
cat("ERROR :", t, conditionMessage(e), "\n")
}
)
}
ERROR : 84 Optimizer (optim) did not achieve convergence (convergence = 10).
Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.There are outcomes with non-positive sampling variances.'V' appears to be not positive definite.
ERROR : 158 Optimizer (optim) did not achieve convergence (convergence = 10).
Rows with NAs omitted from model fitting.
ERROR : 160 NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : 161 NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : 162 NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : 163 NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : 165 NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : 166 NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.There are outcomes with non-positive sampling variances.'V' appears to be not positive definite.Rows with NAs omitted from model fitting.
ERROR : 168 NA/NaN/Inf in 'y'
Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.There are outcomes with non-positive sampling variances.'V' appears to be not positive definite.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.There are outcomes with non-positive sampling variances.'V' appears to be not positive definite.Rows with NAs omitted from model fitting.
ERROR : 231 NA/NaN/Inf in 'y'
In the above function, we use ‘tryCatch’ and ‘conditionMessage’ to prevent the loop from aborting when the first error at row 84 is produced. As convergence in the two listed non-converging cases can’t be achieved by sensibly tweaking (other optim etc.), and we only learn about non-convergence in the loop, it is not possible to exclude the traits (N=2) beforehand. Similarly, there are 8 traits with very low variation, which can not be excluded prior running the loop.
The produced “Warnings” indicate cases where variance components are set to zero during likelihood optimization.
Procedure names, grouping variables and trait names (“parameter_names”) are merged back together with the results from the metafor analysis above.
results_alltraits_grouping2 <-
results_alltraits_grouping %>%
left_join(by="id",
data %>% select(id, parameter_group, procedure = procedure_name, procedure_name, parameter_name) %>% # We filter duplicated id's to get only one unique row per id (and there is one id per parameter_name)
filter(!duplicated(id))
) %>%
# Below we add 'procedure' (from the previously loaded 'procedures.csv') as a variable
left_join(by="procedure",
procedures %>% distinct()
)
(n <- length(unique(results_alltraits_grouping2$parameter_name))) # 232
[1] 232
14 traits from the originally 232 that had been included are removed because they either did not achieve convergence or are nonsensical for analysis of variance (such as traits that show no variation, see list below).
Not converged: “dp t cells”, “mzb (cd21/35 high)”
Not enough variation: “number of caudal vertebrae”, “number of cervical vertebrae”, “number of digits”, “number of lumbar vertebrae”, “number of pelvic vertebrae”, “number of ribs left”,“number of ribs right”, “number of signals”, “number of thoracic vertebrae”, “total number of acquired events in panel a”,“total number of acquired events in panel b”, “whole arena permanence”.
# We exclude 14 parameter names for which metafor models didn't converge ("dp t cells", "mzb (cd21/35 high)"), and of parameters that don't harbour enough variation
meta_clean <- results_alltraits_grouping2 %>%
filter(!parameter_name %in% c("dp t cells", "mzb (cd21/35 high)", "number of caudal vertebrae",
"number of cervical vertebrae", "number of digits", "number of lumbar vertebrae", "number of pelvic vertebrae", "number of ribs left",
"number of ribs right", "number of signals", "number of thoracic vertebrae", "total number of acquired events in panel a",
"total number of acquired events in panel b", "whole arena permanence"))
Reveiw: check against old script – identical, remove once fixed # #Felix: not sure
meta_clean.test <- readRDS(here("export", "meta_clean.test.rds"))
all.equal(meta_clean, meta_clean.test %>% mutate(id=as.integer(id), parameter_group = as.character(parameter_group), GroupingTerm = as.character(GroupingTerm)))
[1] “Rows in x but not y: 162, 161. Rows in y but not x: 162, 161.” Not sure??
(Step F in Figure 3 in main article)
We use this corrected (for correlated traits) “results” table, which contains each of the meta-analytic means for all effect sizes of interest, for further analyses. We further use this table as part of the Shiny App, which is able to provide the percentage differences between males and females for mean, variance and coefficient of variance.
This is the full result dataset
kable(metacombo) %>%
kable_styling() %>%
scroll_box(width = "100%", height = "200px")
parameter_group | counts | procedure | GroupingTerm | lnCVR | lnCVR_lower | lnCVR_upper | lnCVR_se | lnVR | lnVR_lower | lnVR_upper | lnVR_se | lnRR | lnRR_lower | lnRR_upper | lnRR_se |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pre-pulse inhibition | 5 | Acoustic Startle and Pre-pulse Inhibition (PPI) | Behaviour | 0.0232963 | -0.0802563 | 0.1268488 | 0.0370507 | 0.0091028 | -0.0364640 | 0.0546695 | 0.0143431 | -0.0052156 | -0.0427126 | 0.0322815 | 0.0128092 |
B cells | 4 | Immunophenotyping | Immunology | -0.0938959 | -0.2500020 | 0.0622103 | 0.0426972 | -0.0995337 | -0.2068001 | 0.0077328 | 0.0250132 | -0.0026281 | -0.1298230 | 0.1245668 | 0.0393018 |
cd4 nkt | 6 | Immunophenotyping | Immunology | -0.0287688 | -0.0566987 | -0.0008389 | 0.0101634 | -0.2018746 | -0.3102294 | -0.0935198 | 0.0331161 | -0.2344450 | -0.4005266 | -0.0683635 | 0.0633501 |
cd4 t | 7 | Immunophenotyping | Immunology | -0.1507387 | -0.2427976 | -0.0586798 | 0.0360690 | -0.1699213 | -0.2629450 | -0.0768975 | 0.0348324 | -0.0031242 | -0.0411564 | 0.0349081 | 0.0148989 |
cd8 nkt | 6 | Immunophenotyping | Immunology | -0.0424402 | -0.0782046 | -0.0066759 | 0.0119223 | -0.0300442 | -0.1823594 | 0.1222710 | 0.0533765 | 0.0035372 | -0.0573749 | 0.0644494 | 0.0205272 |
cd8 t | 7 | Immunophenotyping | Immunology | -0.1223681 | -0.2179976 | -0.0267387 | 0.0358727 | -0.1581698 | -0.2342579 | -0.0820816 | 0.0270229 | -0.0415806 | -0.0510391 | -0.0321221 | 0.0023119 |
cdcs | 2 | Immunophenotyping | Immunology | -0.0362947 | -0.3588637 | 0.2862742 | 0.0253867 | 0.1080248 | -0.0565718 | 0.2726213 | 0.0129540 | 0.1642541 | -0.1701520 | 0.4986601 | 0.0263183 |
dn nkt | 6 | Immunophenotyping | Immunology | -0.0619371 | -0.1359380 | 0.0120637 | 0.0257746 | -0.1572129 | -0.2814342 | -0.0329915 | 0.0447163 | -0.1727105 | -0.2906356 | -0.0547854 | 0.0441034 |
dn t | 7 | Immunophenotyping | Immunology | -0.0796127 | -0.1844481 | 0.0252227 | 0.0420063 | -0.2421038 | -0.3431678 | -0.1410397 | 0.0406314 | -0.2298147 | -0.2519708 | -0.2076586 | 0.0072373 |
eosinophils | 3 | Hematology | Hematology | -0.0662225 | -0.2806631 | 0.1482181 | 0.0325859 | -0.0154112 | -0.4051652 | 0.3743427 | 0.0865366 | -0.0042422 | -0.2409206 | 0.2324362 | 0.0508093 |
follicular b cells | 2 | Immunophenotyping | Immunology | -0.1160077 | -0.7256692 | 0.4936538 | 0.0479814 | -0.1050194 | -0.6946364 | 0.4845977 | 0.0464039 | 0.0052427 | -0.1872381 | 0.1977236 | 0.0151486 |
luc | 2 | Hematology | Hematology | 0.0180436 | -0.2038464 | 0.2399336 | 0.0174631 | 0.2657035 | -1.2251358 | 1.7565428 | 0.1173316 | 0.2215497 | -1.4136389 | 1.8567382 | 0.1286921 |
lymphocytes | 2 | Hematology | Hematology | 0.0805230 | -2.2618128 | 2.4228588 | 0.1843458 | 0.1550159 | -1.0892706 | 1.3993024 | 0.0979275 | 0.0602144 | -1.0131287 | 1.1335576 | 0.0844739 |
monocytes | 3 | Hematology | Hematology | -0.0214677 | -0.2033706 | 0.1604352 | 0.0420605 | 0.0784876 | -0.1811005 | 0.3380757 | 0.0585593 | 0.1025193 | -0.1483375 | 0.3533762 | 0.0571438 |
neutrophils | 3 | Hematology | Hematology | 0.2587446 | 0.0130803 | 0.5044089 | 0.0557516 | 0.3799805 | -0.2060446 | 0.9660057 | 0.1317980 | 0.1319372 | -0.2669324 | 0.5308068 | 0.0924336 |
nk cells | 6 | Immunophenotyping | Immunology | -0.0414772 | -0.0960406 | 0.0130862 | 0.0200411 | 0.0156533 | -0.0703789 | 0.1016856 | 0.0315487 | 0.0471757 | -0.0162213 | 0.1105728 | 0.0231831 |
nkt cells | 4 | Immunophenotyping | Immunology | 0.0033757 | -0.1069890 | 0.1137404 | 0.0294661 | -0.2458705 | -0.4452333 | -0.0465077 | 0.0426738 | -0.1823355 | -0.3233946 | -0.0412763 | 0.0314580 |
percentage of live gated events | 2 | Immunophenotyping | Immunology | -0.0934933 | -0.3037340 | 0.1167473 | 0.0165463 | -0.0412606 | -0.1414443 | 0.0589231 | 0.0078846 | 0.0500941 | 0.0081191 | 0.0920690 | 0.0033035 |
response amplitude | 10 | Acoustic Startle and Pre-pulse Inhibition (PPI) | Behaviour | 0.0333147 | -0.0127585 | 0.0793879 | 0.0202947 | 0.2549274 | 0.1969787 | 0.3128761 | 0.0255003 | 0.2016062 | 0.1108136 | 0.2923987 | 0.0401164 |
t cells | 3 | Immunophenotyping | Immunology | -0.1338701 | -0.2750284 | 0.0072883 | 0.0326594 | -0.1240786 | -0.4120104 | 0.1638531 | 0.0668611 | -0.0005749 | -0.1663201 | 0.1651702 | 0.0374233 |
12khz-evoked abr threshold | 1 | Auditory Brain Stem Response | Hearing | 0.0538655 | -0.0056830 | 0.1134139 | 0.0303824 | 0.0869649 | 0.0065802 | 0.1673497 | 0.0410134 | 0.0024851 | -0.0214504 | 0.0264205 | 0.0122122 |
18khz-evoked abr threshold | 1 | Auditory Brain Stem Response | Hearing | 0.0238241 | -0.0331809 | 0.0808292 | 0.0290848 | 0.0250266 | -0.0488450 | 0.0988982 | 0.0376903 | -0.0200763 | -0.0431508 | 0.0029982 | 0.0117729 |
24khz-evoked abr threshold | 1 | Auditory Brain Stem Response | Hearing | 0.0518127 | -0.0148242 | 0.1184497 | 0.0339991 | -0.0891510 | -0.3321998 | 0.1538977 | 0.1240067 | -0.0224536 | -0.0444163 | -0.0004910 | 0.0112057 |
30khz-evoked abr threshold | 1 | Auditory Brain Stem Response | Hearing | 0.0170933 | -0.0533187 | 0.0875053 | 0.0359252 | -0.0344797 | -0.1017901 | 0.0328306 | 0.0343426 | -0.0497874 | -0.0748197 | -0.0247550 | 0.0127718 |
6khz-evoked abr threshold | 1 | Auditory Brain Stem Response | Hearing | -0.0077678 | -0.0418582 | 0.0263226 | 0.0173934 | 0.0141682 | -0.0189973 | 0.0473337 | 0.0169215 | 0.0184043 | 0.0056897 | 0.0311189 | 0.0064872 |
alanine aminotransferase | 1 | Clinical Chemistry | Physiology | -0.0684217 | -0.1895020 | 0.0526586 | 0.0617768 | 0.0585179 | -0.1322507 | 0.2492866 | 0.0973327 | 0.1069442 | 0.0319934 | 0.1818950 | 0.0382409 |
albumin | 1 | Clinical Chemistry | Physiology | 0.1133080 | 0.0451475 | 0.1814685 | 0.0347764 | 0.0559995 | -0.0080678 | 0.1200668 | 0.0326880 | -0.0567840 | -0.0732083 | -0.0403597 | 0.0083799 |
alkaline phosphatase | 1 | Clinical Chemistry | Physiology | 0.1043649 | 0.0451585 | 0.1635713 | 0.0302079 | -0.3112471 | -0.3980164 | -0.2244778 | 0.0442709 | -0.4216032 | -0.4694832 | -0.3737231 | 0.0244290 |
alpha-amylase | 1 | Clinical Chemistry | Physiology | 0.0383407 | -0.0423419 | 0.1190232 | 0.0411653 | 0.2795566 | 0.1615777 | 0.3975355 | 0.0601944 | 0.2246987 | 0.1793151 | 0.2700822 | 0.0231553 |
area under glucose response curve | 1 | Intraperitoneal glucose tolerance test (IPGTT) | Metabolism | -0.1531723 | -0.2210551 | -0.0852895 | 0.0346347 | 0.2748396 | 0.1950895 | 0.3545898 | 0.0406896 | 0.4357738 | 0.3655882 | 0.5059595 | 0.0358097 |
aspartate aminotransferase | 1 | Clinical Chemistry | Physiology | 0.0119165 | -0.1228287 | 0.1466617 | 0.0687488 | -0.0566968 | -0.2457779 | 0.1323843 | 0.0964717 | -0.0585577 | -0.1331777 | 0.0160624 | 0.0380722 |
basophil cell count | 1 | Hematology | Hematology | -0.0917931 | -0.2022487 | 0.0186624 | 0.0563559 | 0.2031265 | -0.0131549 | 0.4194079 | 0.1103497 | 0.2675772 | 0.0643028 | 0.4708516 | 0.1037133 |
basophil differential count | 1 | Hematology | Hematology | -0.0934739 | -0.1787512 | -0.0081966 | 0.0435096 | -0.0639511 | -0.2828066 | 0.1549044 | 0.1116630 | -0.0156339 | -0.1102310 | 0.0789633 | 0.0482647 |
bmc/body weight | 1 | Body Composition (DEXA lean/fat) | Morphology | 0.1314998 | 0.0329846 | 0.2300151 | 0.0502638 | -0.0448684 | -0.1340146 | 0.0442777 | 0.0454836 | -0.1722378 | -0.2207030 | -0.1237726 | 0.0247276 |
body length | 1 | Body Composition (DEXA lean/fat) | Morphology | -0.0347988 | -0.0824528 | 0.0128552 | 0.0243137 | -0.0059677 | -0.0526221 | 0.0406866 | 0.0238037 | 0.0282722 | 0.0233254 | 0.0332189 | 0.0025239 |
body temp | 1 | Echo | Heart | -0.0325368 | -0.1066429 | 0.0415693 | 0.0378099 | -0.0303742 | -0.1044537 | 0.0437054 | 0.0377964 | 0.0018532 | -0.0005002 | 0.0042066 | 0.0012008 |
body weight | 1 | Body Weight | Morphology | 0.0245675 | -0.0420402 | 0.0911752 | 0.0339841 | 0.2335793 | 0.1694979 | 0.2976607 | 0.0326952 | 0.2096770 | 0.1938727 | 0.2254813 | 0.0080636 |
body weight after experiment | 1 | Indirect Calorimetry | Metabolism | 0.0853708 | 0.0299665 | 0.1407751 | 0.0282680 | 0.2849370 | 0.2328875 | 0.3369866 | 0.0265564 | 0.2030973 | 0.1864076 | 0.2197871 | 0.0085153 |
body weight before experiment | 1 | Indirect Calorimetry | Metabolism | 0.1053511 | 0.0412461 | 0.1694562 | 0.0327073 | 0.3038998 | 0.2435428 | 0.3642568 | 0.0307949 | 0.2008638 | 0.1816362 | 0.2200914 | 0.0098102 |
bone area | 1 | Body Composition (DEXA lean/fat) | Morphology | 0.0981587 | 0.0272824 | 0.1690349 | 0.0361620 | 0.1286546 | 0.0533659 | 0.2039432 | 0.0384133 | 0.0315241 | 0.0003806 | 0.0626676 | 0.0158898 |
bone mineral content (excluding skull) | 1 | Body Composition (DEXA lean/fat) | Morphology | 0.1709230 | 0.0625642 | 0.2792818 | 0.0552861 | 0.2091372 | 0.1015600 | 0.3167143 | 0.0548873 | 0.0372537 | -0.0130828 | 0.0875902 | 0.0256824 |
bone mineral density (excluding skull) | 1 | Body Composition (DEXA lean/fat) | Morphology | 0.0542638 | -0.0881612 | 0.1966887 | 0.0726671 | 0.0492830 | -0.1087868 | 0.2073528 | 0.0806494 | 0.0012286 | -0.0187942 | 0.0212514 | 0.0102159 |
calcium | 1 | Clinical Chemistry | Physiology | 0.0097946 | -0.0464600 | 0.0660492 | 0.0287018 | 0.0135683 | -0.0424600 | 0.0695966 | 0.0285864 | 0.0036564 | -0.0000609 | 0.0073737 | 0.0018966 |
cardiac output | 1 | Echo | Heart | 0.0133816 | -0.0797535 | 0.1065166 | 0.0475188 | 0.1017991 | 0.0206287 | 0.1829694 | 0.0414142 | 0.0934439 | 0.0580233 | 0.1288645 | 0.0180721 |
center average speed | 1 | Open Field | Behaviour | 0.0167300 | -0.0404735 | 0.0739335 | 0.0291860 | -0.0588515 | -0.1004209 | -0.0172820 | 0.0212093 | -0.0724619 | -0.1149622 | -0.0299616 | 0.0216842 |
center distance travelled | 1 | Open Field | Behaviour | -0.0162603 | -0.0733243 | 0.0408038 | 0.0291149 | -0.1060637 | -0.2023343 | -0.0097930 | 0.0491186 | -0.0940204 | -0.1945774 | 0.0065366 | 0.0513055 |
center permanence time | 1 | Open Field | Behaviour | -0.0253715 | -0.0826435 | 0.0319004 | 0.0292209 | -0.0255734 | -0.1014389 | 0.0502922 | 0.0387076 | -0.0035151 | -0.0902886 | 0.0832585 | 0.0442730 |
center resting time | 1 | Open Field | Behaviour | 0.0244492 | -0.0737922 | 0.1226906 | 0.0501241 | -0.0228690 | -0.1548339 | 0.1090960 | 0.0673303 | -0.0630751 | -0.2215457 | 0.0953955 | 0.0808538 |
chloride | 1 | Clinical Chemistry | Physiology | 0.0321555 | -0.1270972 | 0.1914083 | 0.0812529 | 0.0241491 | -0.1438502 | 0.1921485 | 0.0857155 | -0.0127047 | -0.0177349 | -0.0076745 | 0.0025665 |
click-evoked abr threshold | 1 | Auditory Brain Stem Response | Hearing | -0.0529450 | -0.1534816 | 0.0475915 | 0.0512951 | -0.0561198 | -0.1827679 | 0.0705282 | 0.0646176 | -0.0154221 | -0.0577200 | 0.0268757 | 0.0215809 |
creatine kinase | 1 | Clinical Chemistry | Physiology | 0.0241232 | -0.1071457 | 0.1553920 | 0.0669751 | -0.1318792 | -0.3968974 | 0.1331390 | 0.1352159 | -0.1344413 | -0.3838303 | 0.1149476 | 0.1272416 |
creatinine | 1 | Clinical Chemistry | Physiology | 0.0352315 | -0.0229205 | 0.0933835 | 0.0296699 | 0.1066373 | -0.2200831 | 0.4333578 | 0.1666972 | -0.0844078 | -0.1320251 | -0.0367905 | 0.0242950 |
cv | 1 | Electrocardiogram (ECG) | Heart | 0.1874544 | 0.0716631 | 0.3032457 | 0.0590783 | -0.0895722 | -0.2484833 | 0.0693388 | 0.0810786 | -0.2401301 | -0.3410322 | -0.1392280 | 0.0514816 |
distance travelled - total | 1 | Open Field | Behaviour | -0.0187819 | -0.0858957 | 0.0483318 | 0.0342423 | -0.1272582 | -0.1997426 | -0.0547738 | 0.0369825 | -0.1121373 | -0.1816322 | -0.0426424 | 0.0354572 |
ejection fraction | 1 | Echo | Heart | -0.0300111 | -0.1345066 | 0.0744844 | 0.0533150 | -0.0525735 | -0.1483174 | 0.0431705 | 0.0488499 | -0.0284086 | -0.0492579 | -0.0075592 | 0.0106376 |
end-diastolic diameter | 1 | Echo | Heart | 0.1120972 | 0.0431489 | 0.1810454 | 0.0351783 | 0.1743929 | 0.0875252 | 0.2612607 | 0.0443211 | 0.0600907 | 0.0354923 | 0.0846891 | 0.0125504 |
end-systolic diameter | 1 | Echo | Heart | -0.0084176 | -0.0780811 | 0.0612459 | 0.0355433 | 0.0668966 | -0.0016692 | 0.1354624 | 0.0349832 | 0.0763195 | 0.0451136 | 0.1075254 | 0.0159217 |
fasted blood glucose concentration | 1 | Intraperitoneal glucose tolerance test (IPGTT) | Metabolism | -0.0177245 | -0.1256855 | 0.0902366 | 0.0550832 | 0.0702824 | -0.0302439 | 0.1708087 | 0.0512899 | 0.0868420 | 0.0493007 | 0.1243832 | 0.0191541 |
fat mass | 1 | Body Composition (DEXA lean/fat) | Morphology | 0.0408799 | -0.0430149 | 0.1247746 | 0.0428042 | 0.3714313 | 0.2698790 | 0.4729837 | 0.0518134 | 0.3282080 | 0.2669032 | 0.3895129 | 0.0312786 |
fat/body weight | 1 | Body Composition (DEXA lean/fat) | Morphology | 0.0777327 | -0.0119735 | 0.1674390 | 0.0457693 | 0.2020776 | 0.1083557 | 0.2957996 | 0.0478182 | 0.1235292 | 0.0638629 | 0.1831955 | 0.0304425 |
forelimb and hindlimb grip strength measurement mean | 1 | Grip Strength | Morphology | 0.0578158 | 0.0039998 | 0.1116318 | 0.0274577 | 0.1145986 | 0.0530521 | 0.1761451 | 0.0314018 | 0.0541888 | 0.0294838 | 0.0788938 | 0.0126048 |
forelimb grip strength measurement mean | 1 | Grip Strength | Morphology | 0.0265051 | -0.0187240 | 0.0717341 | 0.0230765 | 0.0995076 | 0.0539740 | 0.1450413 | 0.0232319 | 0.0697061 | 0.0438625 | 0.0955496 | 0.0131857 |
fractional shortening | 1 | Echo | Heart | -0.0148852 | -0.1161666 | 0.0863961 | 0.0516751 | -0.0575326 | -0.1558559 | 0.0407907 | 0.0501659 | -0.0413498 | -0.0567105 | -0.0259891 | 0.0078372 |
free fatty acids | 1 | Clinical Chemistry | Physiology | 0.0281576 | -0.1002531 | 0.1565683 | 0.0655169 | 0.0554109 | -0.0736861 | 0.1845079 | 0.0658670 | 0.0193783 | -0.0093700 | 0.0481266 | 0.0146678 |
fructosamine | 1 | Clinical Chemistry | Physiology | -0.0397864 | -0.1198801 | 0.0403073 | 0.0408649 | -0.0678231 | -0.1513538 | 0.0157075 | 0.0426184 | -0.0283579 | -0.0692447 | 0.0125289 | 0.0208610 |
glucose | 1 | Clinical Chemistry | Physiology | 0.0692601 | 0.0184025 | 0.1201176 | 0.0259482 | 0.1279473 | 0.0423001 | 0.2135946 | 0.0436984 | 0.0650887 | 0.0218496 | 0.1083279 | 0.0220612 |
hdl-cholesterol | 1 | Clinical Chemistry | Physiology | -0.0650177 | -0.1255786 | -0.0044568 | 0.0308990 | 0.1724354 | 0.0701062 | 0.2747646 | 0.0522097 | 0.2606961 | 0.2180421 | 0.3033501 | 0.0217626 |
heart weight | 1 | Heart Weight | Morphology | 0.1766832 | 0.0672843 | 0.2860820 | 0.0558168 | 0.3651806 | 0.2169840 | 0.5133772 | 0.0756119 | 0.1737615 | 0.1409037 | 0.2066193 | 0.0167645 |
heart weight normalised against body weight | 1 | Heart Weight | Morphology | 0.0794303 | -0.0060591 | 0.1649198 | 0.0436179 | 0.0355574 | -0.0973272 | 0.1684419 | 0.0677995 | -0.0495578 | -0.0835809 | -0.0155346 | 0.0173591 |
hematocrit | 1 | Hematology | Hematology | 0.0566356 | -0.0516862 | 0.1649575 | 0.0552673 | 0.0737071 | -0.0328632 | 0.1802774 | 0.0543736 | 0.0173967 | 0.0035179 | 0.0312754 | 0.0070811 |
hemoglobin | 1 | Hematology | Hematology | 0.0867000 | 0.0269936 | 0.1464064 | 0.0304630 | 0.0867345 | 0.0194022 | 0.1540668 | 0.0343538 | 0.0051992 | -0.0080216 | 0.0184199 | 0.0067454 |
hr | 1 | Electrocardiogram (ECG) | Heart | -0.0634490 | -0.1734699 | 0.0465718 | 0.0561341 | -0.0140315 | -0.1488474 | 0.1207843 | 0.0687849 | 0.0406617 | -0.0139214 | 0.0952448 | 0.0278490 |
hrv | 1 | Electrocardiogram (ECG) | Heart | 0.1722593 | 0.1094294 | 0.2350892 | 0.0320567 | -0.0813225 | -0.2125462 | 0.0499011 | 0.0669521 | -0.2504990 | -0.3657436 | -0.1352545 | 0.0587993 |
initial response to glucose challenge | 1 | Intraperitoneal glucose tolerance test (IPGTT) | Metabolism | -0.0968821 | -0.1503780 | -0.0433861 | 0.0272943 | 0.0429971 | 0.0141807 | 0.0718136 | 0.0147026 | 0.1183626 | 0.0853242 | 0.1514009 | 0.0168566 |
insulin | 1 | Insulin Blood Level | Metabolism | -0.0993292 | -0.3721975 | 0.1735391 | 0.1392211 | 0.1774003 | -0.1938091 | 0.5486096 | 0.1893960 | 0.4445455 | 0.0944498 | 0.7946412 | 0.1786236 |
iron | 1 | Clinical Chemistry | Physiology | -0.0974214 | -0.2141737 | 0.0193310 | 0.0595686 | -0.2534898 | -0.3963648 | -0.1106147 | 0.0728968 | -0.1527977 | -0.1930307 | -0.1125646 | 0.0205274 |
lactate dehydrogenase | 1 | Clinical Chemistry | Physiology | 0.0941249 | -0.0214022 | 0.2096519 | 0.0589435 | 0.1409270 | -0.0620594 | 0.3439133 | 0.1035664 | 0.0318801 | -0.1412218 | 0.2049819 | 0.0883189 |
latency to center entry | 1 | Open Field | Behaviour | 0.1254239 | 0.0330185 | 0.2178293 | 0.0471465 | 0.3641221 | 0.2056000 | 0.5226441 | 0.0808801 | 0.2734519 | 0.0739366 | 0.4729672 | 0.1017954 |
ldl-cholesterol | 1 | Clinical Chemistry | Physiology | 0.4231644 | 0.1551776 | 0.6911512 | 0.1367305 | 0.2669283 | -0.0956833 | 0.6295400 | 0.1850093 | -0.1615499 | -0.6010478 | 0.2779480 | 0.2242378 |
lean mass | 1 | Body Composition (DEXA lean/fat) | Morphology | 0.1435756 | 0.0759342 | 0.2112170 | 0.0345115 | 0.3382447 | 0.2664863 | 0.4100031 | 0.0366121 | 0.1928945 | 0.1752425 | 0.2105465 | 0.0090063 |
lean/body weight | 1 | Body Composition (DEXA lean/fat) | Morphology | 0.1953833 | 0.0912480 | 0.2995186 | 0.0531312 | 0.1840786 | 0.0863764 | 0.2817807 | 0.0498490 | -0.0122785 | -0.0257504 | 0.0011934 | 0.0068736 |
left anterior chamber depth | 1 | Eye Morphology | Eye | -0.1854856 | -0.4305058 | 0.0595347 | 0.1250126 | -0.1534983 | -0.4007283 | 0.0937316 | 0.1261401 | 0.0331746 | 0.0284172 | 0.0379321 | 0.0024273 |
left corneal thickness | 1 | Eye Morphology | Eye | -0.1446634 | -0.2339950 | -0.0553319 | 0.0455782 | -0.1352252 | -0.2234178 | -0.0470327 | 0.0449970 | 0.0075283 | -0.0057082 | 0.0207648 | 0.0067535 |
left inner nuclear layer | 1 | Eye Morphology | Eye | 0.0480458 | -0.0360706 | 0.1321622 | 0.0429173 | 0.0487217 | -0.0347622 | 0.1322057 | 0.0425946 | 0.0006956 | -0.0095012 | 0.0108923 | 0.0052025 |
left outer nuclear layer | 1 | Eye Morphology | Eye | -0.0675012 | -0.1511666 | 0.0161641 | 0.0426872 | -0.0618025 | -0.1452865 | 0.0216814 | 0.0425946 | 0.0063811 | 0.0011702 | 0.0115921 | 0.0026587 |
left posterior chamber depth | 1 | Eye Morphology | Eye | -0.2631046 | -0.4734756 | -0.0527336 | 0.1073341 | -0.2687360 | -0.4790035 | -0.0584686 | 0.1072813 | -0.0026027 | -0.0146655 | 0.0094600 | 0.0061546 |
left total retinal thickness | 1 | Eye Morphology | Eye | -0.1975770 | -0.4386627 | 0.0435087 | 0.1230052 | -0.1932648 | -0.4269751 | 0.0404456 | 0.1192422 | 0.0027995 | -0.0034907 | 0.0090898 | 0.0032094 |
locomotor activity | 1 | Combined SHIRPA and Dysmorphology | Behaviour | 0.0960106 | 0.0224214 | 0.1695997 | 0.0375462 | -0.0159064 | -0.0579694 | 0.0261566 | 0.0214611 | -0.1105803 | -0.1761043 | -0.0450562 | 0.0334313 |
lvawd | 1 | Echo | Heart | 0.0228924 | -0.0247048 | 0.0704896 | 0.0242847 | 0.0454075 | -0.0013249 | 0.0921399 | 0.0238435 | 0.0246614 | 0.0114095 | 0.0379132 | 0.0067613 |
lvaws | 1 | Echo | Heart | -0.0017749 | -0.2517581 | 0.2482083 | 0.1275448 | 0.0232601 | -0.1776617 | 0.2241819 | 0.1025130 | 0.0112569 | -0.0306073 | 0.0531211 | 0.0213597 |
lvidd | 1 | Echo | Heart | 0.0453256 | -0.0241892 | 0.1148405 | 0.0354674 | 0.0981450 | 0.0208146 | 0.1754754 | 0.0394550 | 0.0528053 | 0.0378669 | 0.0677436 | 0.0076218 |
lvids | 1 | Echo | Heart | -0.0635228 | -0.1990947 | 0.0720491 | 0.0691706 | 0.0083352 | -0.1335894 | 0.1502598 | 0.0724118 | 0.0756177 | 0.0525777 | 0.0986576 | 0.0117553 |
lvpwd | 1 | Echo | Heart | -0.0317376 | -0.1258062 | 0.0623311 | 0.0479951 | -0.0104248 | -0.1271922 | 0.1063426 | 0.0595763 | 0.0302674 | 0.0131900 | 0.0473448 | 0.0087131 |
lvpws | 1 | Echo | Heart | -0.0190522 | -0.1014670 | 0.0633627 | 0.0420492 | 0.0089592 | -0.0823356 | 0.1002540 | 0.0465798 | 0.0268487 | 0.0063146 | 0.0473828 | 0.0104768 |
magnesium | 1 | Urinalysis | Physiology | 0.0161699 | -0.0231196 | 0.0554593 | 0.0200460 | -0.0513056 | -0.1167021 | 0.0140909 | 0.0333662 | -0.0413354 | -0.1135580 | 0.0308871 | 0.0368489 |
mean cell hemoglobin concentration | 1 | Hematology | Hematology | 0.0378015 | -0.0880637 | 0.1636666 | 0.0642181 | 0.0253063 | -0.1086076 | 0.1592202 | 0.0683247 | -0.0113450 | -0.0150702 | -0.0076199 | 0.0019006 |
mean cell volume | 1 | Hematology | Hematology | 0.0039175 | -0.0957495 | 0.1035845 | 0.0508514 | -0.0030447 | -0.0961742 | 0.0900848 | 0.0475159 | -0.0063502 | -0.0099649 | -0.0027355 | 0.0018443 |
mean corpuscular hemoglobin | 1 | Hematology | Hematology | -0.0025833 | -0.0653065 | 0.0601398 | 0.0320022 | -0.0193465 | -0.0824670 | 0.0437741 | 0.0322049 | -0.0169768 | -0.0197231 | -0.0142305 | 0.0014012 |
mean platelet volume | 1 | Hematology | Hematology | 0.0487366 | -0.0044688 | 0.1019419 | 0.0271461 | 0.0353913 | -0.0210323 | 0.0918150 | 0.0287881 | -0.0174066 | -0.0276044 | -0.0072089 | 0.0052030 |
mean r amplitude | 1 | Electrocardiogram (ECG) | Heart | 0.0084703 | -0.0282092 | 0.0451499 | 0.0187144 | -0.0948208 | -0.1630495 | -0.0265922 | 0.0348112 | -0.0835612 | -0.1503108 | -0.0168116 | 0.0340565 |
mean sr amplitude | 1 | Electrocardiogram (ECG) | Heart | 0.0284617 | -0.0131943 | 0.0701178 | 0.0212535 | -0.0876811 | -0.1270777 | -0.0482845 | 0.0201007 | -0.1130259 | -0.1558048 | -0.0702470 | 0.0218264 |
number of center entries | 1 | Open Field | Behaviour | 0.0150703 | -0.0534907 | 0.0836313 | 0.0349807 | -0.0361259 | -0.0952472 | 0.0229955 | 0.0301645 | -0.0588092 | -0.1679907 | 0.0503723 | 0.0557059 |
number of rears - total | 1 | Open Field | Behaviour | -0.0011326 | -0.1141113 | 0.1118461 | 0.0576432 | 0.1869490 | -0.0392422 | 0.4131402 | 0.1154058 | 0.1794328 | 0.0568682 | 0.3019974 | 0.0625341 |
others | 1 | Immunophenotyping | Immunology | -0.1684902 | -0.2596648 | -0.0773156 | 0.0465185 | -0.1515195 | -0.2435956 | -0.0594434 | 0.0469785 | 0.0196158 | 0.0049349 | 0.0342967 | 0.0074904 |
pdcs | 1 | Immunophenotyping | Immunology | -0.1732553 | -0.4003845 | 0.0538738 | 0.1158844 | -0.2572491 | -0.7186201 | 0.2041219 | 0.2353977 | -0.0915619 | -0.2522236 | 0.0690997 | 0.0819717 |
percentage center time | 1 | Open Field | Behaviour | -0.0219679 | -0.0863184 | 0.0423826 | 0.0328325 | -0.0188907 | -0.0912088 | 0.0534274 | 0.0368977 | -0.0061802 | -0.0972542 | 0.0848938 | 0.0464672 |
periphery average speed | 1 | Open Field | Behaviour | -0.0444272 | -0.1082870 | 0.0194327 | 0.0325822 | -0.1401304 | -0.2117709 | -0.0684898 | 0.0365520 | -0.0963838 | -0.1446043 | -0.0481633 | 0.0246028 |
periphery distance travelled | 1 | Open Field | Behaviour | -0.0313217 | -0.0918314 | 0.0291879 | 0.0308728 | -0.1342236 | -0.1874097 | -0.0810376 | 0.0271362 | -0.1037239 | -0.1714836 | -0.0359643 | 0.0345719 |
periphery permanence time | 1 | Open Field | Behaviour | -0.0369177 | -0.1277076 | 0.0538721 | 0.0463222 | -0.0294978 | -0.1006346 | 0.0416390 | 0.0362950 | 0.0077038 | -0.0137850 | 0.0291927 | 0.0109639 |
periphery resting time | 1 | Open Field | Behaviour | -0.0536346 | -0.1266045 | 0.0193353 | 0.0372302 | -0.0572459 | -0.1071515 | -0.0073404 | 0.0254625 | 0.0026007 | -0.0558538 | 0.0610552 | 0.0298243 |
phosphorus | 1 | Clinical Chemistry | Physiology | -0.0485897 | -0.0839101 | -0.0132693 | 0.0180209 | -0.0826120 | -0.1576473 | -0.0075767 | 0.0382840 | -0.0420616 | -0.0813582 | -0.0027650 | 0.0200497 |
platelet count | 1 | Hematology | Hematology | 0.0737198 | 0.0205862 | 0.1268534 | 0.0271095 | 0.2415135 | 0.1865330 | 0.2964940 | 0.0280518 | 0.1642192 | 0.1369820 | 0.1914563 | 0.0138968 |
pnn5(6>ms) | 1 | Electrocardiogram (ECG) | Heart | 0.2906905 | 0.1716202 | 0.4097607 | 0.0607512 | -0.2926013 | -0.5272121 | -0.0579905 | 0.1197016 | -0.6004767 | -0.9244113 | -0.2765420 | 0.1652758 |
potassium | 1 | Clinical Chemistry | Physiology | -0.0705522 | -0.2214989 | 0.0803945 | 0.0770150 | -0.0074675 | -0.1729366 | 0.1580015 | 0.0844245 | 0.0704162 | 0.0476647 | 0.0931676 | 0.0116081 |
pq | 1 | Electrocardiogram (ECG) | Heart | -0.0650960 | -0.1538776 | 0.0236857 | 0.0452976 | -0.0648322 | -0.1270688 | -0.0025955 | 0.0317540 | 0.0015656 | -0.0259865 | 0.0291178 | 0.0140575 |
pr | 1 | Electrocardiogram (ECG) | Heart | -0.0564860 | -0.1048371 | -0.0081349 | 0.0246694 | -0.0754718 | -0.1235224 | -0.0274213 | 0.0245160 | -0.0183785 | -0.0319887 | -0.0047684 | 0.0069441 |
qrs | 1 | Electrocardiogram (ECG) | Heart | 0.0725454 | 0.0354722 | 0.1096185 | 0.0189152 | 0.0681074 | 0.0300869 | 0.1061278 | 0.0193986 | -0.0054233 | -0.0154885 | 0.0046418 | 0.0051354 |
qtc | 1 | Electrocardiogram (ECG) | Heart | 0.0328106 | -0.0101032 | 0.0757244 | 0.0218952 | 0.0310473 | -0.0207365 | 0.0828310 | 0.0264208 | -0.0005046 | -0.0085696 | 0.0075604 | 0.0041149 |
qtc dispersion | 1 | Electrocardiogram (ECG) | Heart | 0.0031258 | -0.0523919 | 0.0586435 | 0.0283259 | -0.0046501 | -0.1060530 | 0.0967528 | 0.0517371 | -0.0077373 | -0.0510162 | 0.0355416 | 0.0220815 |
red blood cell count | 1 | Hematology | Hematology | 0.0773455 | 0.0071933 | 0.1474977 | 0.0357926 | 0.0997278 | 0.0316996 | 0.1677560 | 0.0347089 | 0.0228493 | 0.0088583 | 0.0368404 | 0.0071384 |
red blood cell distribution width | 1 | Hematology | Hematology | 0.1248464 | -0.0035148 | 0.2532076 | 0.0654916 | 0.1353460 | -0.0035862 | 0.2742782 | 0.0708851 | 0.0104789 | -0.0032056 | 0.0241635 | 0.0069821 |
respiration rate | 1 | Echo | Heart | -0.1384843 | -0.2178736 | -0.0590950 | 0.0405055 | -0.0703570 | -0.1795875 | 0.0388735 | 0.0557309 | 0.0611034 | 0.0227141 | 0.0994926 | 0.0195867 |
respiratory exchange ratio | 1 | Indirect Calorimetry | Metabolism | -0.0116565 | -0.0896490 | 0.0663361 | 0.0397928 | -0.0106530 | -0.0878483 | 0.0665424 | 0.0393861 | 0.0017027 | -0.0057348 | 0.0091402 | 0.0037947 |
right anterior chamber depth | 1 | Eye Morphology | Eye | -0.4491432 | -1.3293546 | 0.4310682 | 0.4490957 | -0.4157377 | -1.2918620 | 0.4603867 | 0.4470104 | 0.0316098 | 0.0264512 | 0.0367685 | 0.0026320 |
right corneal thickness | 1 | Eye Morphology | Eye | -0.0355898 | -0.2280522 | 0.1568726 | 0.0981969 | -0.0306550 | -0.1963692 | 0.1350592 | 0.0845496 | -0.0013855 | -0.0237830 | 0.0210121 | 0.0114275 |
right inner nuclear layer | 1 | Eye Morphology | Eye | -0.2545083 | -0.7633116 | 0.2542949 | 0.2595983 | -0.2785114 | -0.8373133 | 0.2802906 | 0.2851083 | -0.0175090 | -0.0664158 | 0.0313978 | 0.0249529 |
right outer nuclear layer | 1 | Eye Morphology | Eye | 0.0061253 | -0.0781241 | 0.0903746 | 0.0429851 | 0.0109098 | -0.0731427 | 0.0949622 | 0.0428847 | 0.0055513 | 0.0000519 | 0.0110508 | 0.0028059 |
right posterior chamber depth | 1 | Eye Morphology | Eye | -0.0775673 | -0.2905688 | 0.1354341 | 0.1086762 | -0.0764571 | -0.2893152 | 0.1364010 | 0.1086031 | 0.0071990 | -0.0178434 | 0.0322413 | 0.0127769 |
right total retinal thickness | 1 | Eye Morphology | Eye | -0.1987993 | -0.6457320 | 0.2481333 | 0.2280310 | -0.1925482 | -0.6285715 | 0.2434750 | 0.2224649 | 0.0052882 | -0.0045957 | 0.0151720 | 0.0050429 |
rmssd | 1 | Electrocardiogram (ECG) | Heart | 0.1800273 | -0.0882317 | 0.4482864 | 0.1368694 | -0.0161048 | -0.4112809 | 0.3790712 | 0.2016241 | -0.1178703 | -0.2449843 | 0.0092436 | 0.0648552 |
rp macrophage (cd19- cd11c-) | 1 | Immunophenotyping | Immunology | -0.0765771 | -0.3398075 | 0.1866533 | 0.1343037 | -0.0747691 | -0.3351316 | 0.1855933 | 0.1328404 | -0.0746396 | -0.2072980 | 0.0580188 | 0.0676841 |
rr | 1 | Electrocardiogram (ECG) | Heart | -0.0761505 | -0.1876687 | 0.0353678 | 0.0568981 | -0.0896869 | -0.2063458 | 0.0269721 | 0.0595210 | -0.0125023 | -0.0214082 | -0.0035963 | 0.0045440 |
sodium | 1 | Clinical Chemistry | Physiology | 0.0262100 | -0.1171674 | 0.1695873 | 0.0731531 | 0.0338228 | -0.1337162 | 0.2013618 | 0.0854806 | 0.0099680 | 0.0065815 | 0.0133545 | 0.0017278 |
spleen weight | 1 | Immunophenotyping | Immunology | 0.1874259 | -0.0500875 | 0.4249393 | 0.1211825 | 0.1133706 | -0.1604807 | 0.3872220 | 0.1397227 | -0.1542349 | -0.2104415 | -0.0980283 | 0.0286774 |
st | 1 | Electrocardiogram (ECG) | Heart | 0.0032888 | -0.0544512 | 0.0610288 | 0.0294597 | -0.0054976 | -0.0811810 | 0.0701858 | 0.0386147 | -0.0034902 | -0.0175917 | 0.0106113 | 0.0071948 |
stroke volume | 1 | Echo | Heart | 0.0594276 | -0.0782445 | 0.1970997 | 0.0702422 | 0.1574330 | 0.0091891 | 0.3056769 | 0.0756360 | 0.0937375 | 0.0775587 | 0.1099162 | 0.0082546 |
tibia length | 1 | Heart Weight | Morphology | -0.1475403 | -0.4396127 | 0.1445320 | 0.1490192 | -0.1374401 | -0.4261352 | 0.1512551 | 0.1472961 | 0.0095199 | 0.0059199 | 0.0131200 | 0.0018368 |
total bilirubin | 1 | Clinical Chemistry | Physiology | 0.0605449 | -0.0097669 | 0.1308567 | 0.0358740 | 0.0022671 | -0.0859910 | 0.0905252 | 0.0450305 | -0.0550333 | -0.0979518 | -0.0121148 | 0.0218976 |
total cholesterol | 1 | Clinical Chemistry | Physiology | 0.0942595 | -0.0751596 | 0.2636786 | 0.0864399 | 0.3142208 | 0.1125613 | 0.5158803 | 0.1028894 | 0.2027583 | 0.1750477 | 0.2304688 | 0.0141383 |
total food intake | 1 | Indirect Calorimetry | Metabolism | -0.1192293 | -0.2542902 | 0.0158316 | 0.0689099 | -0.0964842 | -0.2564912 | 0.0635228 | 0.0816377 | 0.0267691 | -0.0233285 | 0.0768667 | 0.0255605 |
total protein | 1 | Clinical Chemistry | Physiology | -0.0422347 | -0.0623878 | -0.0220816 | 0.0102824 | -0.0355909 | -0.0619127 | -0.0092692 | 0.0134297 | 0.0092660 | -0.0008158 | 0.0193478 | 0.0051439 |
total water intake | 1 | Indirect Calorimetry | Metabolism | -0.1457383 | -0.2373165 | -0.0541601 | 0.0467244 | -0.2097443 | -0.2681948 | -0.1512937 | 0.0298223 | -0.0654284 | -0.1374220 | 0.0065653 | 0.0367321 |
triglycerides | 1 | Clinical Chemistry | Physiology | -0.0320020 | -0.1233659 | 0.0593619 | 0.0466151 | 0.3268957 | 0.2087111 | 0.4450803 | 0.0602994 | 0.3473552 | 0.2592006 | 0.4355098 | 0.0449777 |
urea (blood urea nitrogen - bun) | 1 | Clinical Chemistry | Physiology | -0.1405306 | -0.2664120 | -0.0146491 | 0.0642264 | -0.0950040 | -0.2507897 | 0.0607817 | 0.0794840 | 0.0403162 | 0.0051883 | 0.0754441 | 0.0179227 |
uric acid | 1 | Clinical Chemistry | Physiology | 0.0367062 | -0.0660619 | 0.1394744 | 0.0524337 | 0.3626957 | 0.0914512 | 0.6339402 | 0.1383926 | 0.4472349 | -0.0801891 | 0.9746588 | 0.2690988 |
white blood cell count | 1 | Hematology | Hematology | -0.0907957 | -0.1703063 | -0.0112852 | 0.0405673 | 0.1168446 | -0.0023934 | 0.2360826 | 0.0608368 | 0.1978876 | 0.1368305 | 0.2589447 | 0.0311521 |
whole arena average speed | 1 | Open Field | Behaviour | -0.0156634 | -0.0857564 | 0.0544296 | 0.0357624 | -0.1140149 | -0.1840029 | -0.0440269 | 0.0357088 | -0.0997437 | -0.1519566 | -0.0475307 | 0.0266397 |
whole arena resting time | 1 | Open Field | Behaviour | -0.0531307 | -0.1011672 | -0.0050941 | 0.0245089 | -0.0593672 | -0.1076067 | -0.0111276 | 0.0246125 | 0.0045878 | -0.0513396 | 0.0605152 | 0.0285349 |
# trait_meta_results <- write.csv(metacombo, file = "export/trait_meta_results.csv")
(Section H in Figure 3 in main article)
Nesting, calculating the number of parameters within each grouping term, and running the meta-analysis
metacombo_final <- metacombo %>%
group_by(GroupingTerm) %>%
nest_legacy() # we're using 'nest_legacy' to keep old syntax/functionality
# **calculate number of parameters per grouping term
metacombo_final <- metacombo_final %>% mutate(para_per_GroupingTerm = map_dbl(data, nrow))
# For all grouping terms
metacombo_final_all <- metacombo %>%
nest_legacy() #'nest_legacy' to keep old syntax/functionality
# **Final fixed effects meta-analyses within grouping terms, with SE of the estimate
overall1 <- metacombo_final %>%
mutate(
model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)),
model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)),
model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
))
)
# **Final fixed effects meta-analyses ACROSS grouping terms, with SE of the estimate
overall_all1 <- metacombo_final_all %>%
mutate(
model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)),
model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)),
model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
))
)
We here delete unused variables, and select the respective effect sizes. Please note - the referencing of the cells does NOT depend on previous ordering of the data. This would only be affected if the output structure from metafor::rma.uni changes.
Behaviour <- as.data.frame(overall1 %>% filter(., GroupingTerm == "Behaviour") %>% mutate(
lnCVR = .[[4]][[1]]$b, lnCVR_lower = .[[4]][[1]]$ci.lb, lnCVR_upper = .[[4]][[1]]$ci.ub, lnCVR_se = .[[4]][[1]]$se,
lnVR = .[[5]][[1]]$b, lnVR_lower = .[[5]][[1]]$ci.lb, lnVR_upper = .[[5]][[1]]$ci.ub, lnVR_se = .[[5]][[1]]$se,
lnRR = .[[6]][[1]]$b, lnRR_lower = .[[6]][[1]]$ci.lb, lnRR_upper = .[[6]][[1]]$ci.ub, lnRR_se = .[[6]][[1]]$se
))[, c(1, 7:18)]
Immunology <- as.data.frame(overall1 %>% filter(., GroupingTerm == "Immunology") %>% mutate(
lnCVR = .[[4]][[1]]$b, lnCVR_lower = .[[4]][[1]]$ci.lb, lnCVR_upper = .[[4]][[1]]$ci.ub, lnCVR_se = .[[4]][[1]]$se,
lnVR = .[[5]][[1]]$b, lnVR_lower = .[[5]][[1]]$ci.lb, lnVR_upper = .[[5]][[1]]$ci.ub, lnVR_se = .[[5]][[1]]$se,
lnRR = .[[6]][[1]]$b, lnRR_lower = .[[6]][[1]]$ci.lb, lnRR_upper = .[[6]][[1]]$ci.ub, lnRR_se = .[[6]][[1]]$se
))[, c(1, 7:18)]
Hematology <- as.data.frame(overall1 %>% filter(., GroupingTerm == "Hematology") %>% mutate(
lnCVR = .[[4]][[1]]$b, lnCVR_lower = .[[4]][[1]]$ci.lb, lnCVR_upper = .[[4]][[1]]$ci.ub, lnCVR_se = .[[4]][[1]]$se,
lnVR = .[[5]][[1]]$b, lnVR_lower = .[[5]][[1]]$ci.lb, lnVR_upper = .[[5]][[1]]$ci.ub, lnVR_se = .[[5]][[1]]$se,
lnRR = .[[6]][[1]]$b, lnRR_lower = .[[6]][[1]]$ci.lb, lnRR_upper = .[[6]][[1]]$ci.ub, lnRR_se = .[[6]][[1]]$se
))[, c(1, 7:18)]
Hearing <- as.data.frame(overall1 %>% filter(., GroupingTerm == "Hearing") %>% mutate(
lnCVR = .[[4]][[1]]$b, lnCVR_lower = .[[4]][[1]]$ci.lb, lnCVR_upper = .[[4]][[1]]$ci.ub, lnCVR_se = .[[4]][[1]]$se,
lnVR = .[[5]][[1]]$b, lnVR_lower = .[[5]][[1]]$ci.lb, lnVR_upper = .[[5]][[1]]$ci.ub, lnVR_se = .[[5]][[1]]$se,
lnRR = .[[6]][[1]]$b, lnRR_lower = .[[6]][[1]]$ci.lb, lnRR_upper = .[[6]][[1]]$ci.ub, lnRR_se = .[[6]][[1]]$se
))[, c(1, 7:18)]
Physiology <- as.data.frame(overall1 %>% filter(., GroupingTerm == "Physiology") %>% mutate(
lnCVR = .[[4]][[1]]$b, lnCVR_lower = .[[4]][[1]]$ci.lb, lnCVR_upper = .[[4]][[1]]$ci.ub, lnCVR_se = .[[4]][[1]]$se,
lnVR = .[[5]][[1]]$b, lnVR_lower = .[[5]][[1]]$ci.lb, lnVR_upper = .[[5]][[1]]$ci.ub, lnVR_se = .[[5]][[1]]$se,
lnRR = .[[6]][[1]]$b, lnRR_lower = .[[6]][[1]]$ci.lb, lnRR_upper = .[[6]][[1]]$ci.ub, lnRR_se = .[[6]][[1]]$se
))[, c(1, 7:18)]
Metabolism <- as.data.frame(overall1 %>% filter(., GroupingTerm == "Metabolism") %>% mutate(
lnCVR = .[[4]][[1]]$b, lnCVR_lower = .[[4]][[1]]$ci.lb, lnCVR_upper = .[[4]][[1]]$ci.ub, lnCVR_se = .[[4]][[1]]$se,
lnVR = .[[5]][[1]]$b, lnVR_lower = .[[5]][[1]]$ci.lb, lnVR_upper = .[[5]][[1]]$ci.ub, lnVR_se = .[[5]][[1]]$se,
lnRR = .[[6]][[1]]$b, lnRR_lower = .[[6]][[1]]$ci.lb, lnRR_upper = .[[6]][[1]]$ci.ub, lnRR_se = .[[6]][[1]]$se
))[, c(1, 7:18)]
Morphology <- as.data.frame(overall1 %>% filter(., GroupingTerm == "Morphology") %>% mutate(
lnCVR = .[[4]][[1]]$b, lnCVR_lower = .[[4]][[1]]$ci.lb, lnCVR_upper = .[[4]][[1]]$ci.ub, lnCVR_se = .[[4]][[1]]$se,
lnVR = .[[5]][[1]]$b, lnVR_lower = .[[5]][[1]]$ci.lb, lnVR_upper = .[[5]][[1]]$ci.ub, lnVR_se = .[[5]][[1]]$se,
lnRR = .[[6]][[1]]$b, lnRR_lower = .[[6]][[1]]$ci.lb, lnRR_upper = .[[6]][[1]]$ci.ub, lnRR_se = .[[6]][[1]]$se
))[, c(1, 7:18)]
Heart <- as.data.frame(overall1 %>% filter(., GroupingTerm == "Heart") %>% mutate(
lnCVR = .[[4]][[1]]$b, lnCVR_lower = .[[4]][[1]]$ci.lb, lnCVR_upper = .[[4]][[1]]$ci.ub, lnCVR_se = .[[4]][[1]]$se,
lnVR = .[[5]][[1]]$b, lnVR_lower = .[[5]][[1]]$ci.lb, lnVR_upper = .[[5]][[1]]$ci.ub, lnVR_se = .[[5]][[1]]$se,
lnRR = .[[6]][[1]]$b, lnRR_lower = .[[6]][[1]]$ci.lb, lnRR_upper = .[[6]][[1]]$ci.ub, lnRR_se = .[[6]][[1]]$se
))[, c(1, 7:18)]
Eye <- as.data.frame(overall1 %>% filter(., GroupingTerm == "Eye") %>% mutate(
lnCVR = .[[4]][[1]]$b, lnCVR_lower = .[[4]][[1]]$ci.lb, lnCVR_upper = .[[4]][[1]]$ci.ub, lnCVR_se = .[[4]][[1]]$se,
lnVR = .[[5]][[1]]$b, lnVR_lower = .[[5]][[1]]$ci.lb, lnVR_upper = .[[5]][[1]]$ci.ub, lnVR_se = .[[5]][[1]]$se,
lnRR = .[[6]][[1]]$b, lnRR_lower = .[[6]][[1]]$ci.lb, lnRR_upper = .[[6]][[1]]$ci.ub, lnRR_se = .[[6]][[1]]$se
))[, c(1, 7:18)]
All <- as.data.frame(overall_all1 %>% mutate(
lnCVR = .[[2]][[1]]$b, lnCVR_lower = .[[2]][[1]]$ci.lb, lnCVR_upper = .[[2]][[1]]$ci.ub, lnCVR_se = .[[2]][[1]]$se, lnVR = .[[3]][[1]]$b, lnVR_lower = .[[3]][[1]]$ci.lb, lnVR_upper = .[[3]][[1]]$ci.ub, lnVR_se = .[[3]][[1]]$se,
lnRR = .[[4]][[1]]$b, lnRR_lower = .[[4]][[1]]$ci.lb, lnRR_upper = .[[4]][[1]]$ci.ub, lnRR_se = .[[4]][[1]]$se
))[, c(5:16)]
All$lnCVR <- as.numeric(All$lnCVR)
All$lnVR <- as.numeric(All$lnVR)
All$lnRR <- as.numeric(All$lnRR)
All <- All %>% mutate(GroupingTerm = "All")
overall2 <- bind_rows(Behaviour, Morphology, Metabolism, Physiology, Immunology, Hematology, Heart, Hearing, Eye, All) #FZ: warnings are ok
This includes all separate eligible traits. Re-ordering of grouping terms
meta_clean$GroupingTerm <- factor(meta_clean$GroupingTerm, levels = c("Behaviour", "Morphology", "Metabolism", "Physiology", "Immunology", "Hematology", "Heart", "Hearing", "Eye"))
meta_clean$GroupingTerm <- factor(meta_clean$GroupingTerm, rev(levels(meta_clean$GroupingTerm)))
# *Preparing data for all traits
meta.plot2.all <- meta_clean %>%
select(lnCVR, lnVR, lnRR, GroupingTerm) %>%
arrange(GroupingTerm)
meta.plot2.all.b <- gather(meta.plot2.all, trait, value, c(lnCVR, lnRR)) # lnVR has been removed here and in the steps below, as this is only included in the supplemental figure
meta.plot2.all.b$trait <- factor(meta.plot2.all.b$trait, levels = c("lnCVR", "lnRR"))
meta.plot2.all.c <- meta.plot2.all.b %>%
group_by_at(vars(trait, GroupingTerm)) %>%
summarise(
malebias = sum(value > 0), femalebias = sum(value <= 0), total = malebias + femalebias,
malepercent = malebias * 100 / total, femalepercent = femalebias * 100 / total
)
meta.plot2.all.c$label <- "All traits"
# restructure to create stacked bar plots
meta.plot2.all.d <- as.data.frame(meta.plot2.all.c)
meta.plot2.all.e <- gather(meta.plot2.all.d, key = sex, value = percent, malepercent:femalepercent, factor_key = TRUE)
# create new sample size variable
meta.plot2.all.e$samplesize <- with(meta.plot2.all.e, ifelse(sex == "malepercent", malebias, femalebias))
# add summary row ('All') and re-arrange rows into correct order for plotting #FZ added
meta.plot2.all.f <- meta.plot2.all.e %>% group_by(trait, sex) %>%
summarise(GroupingTerm = "All", malebias = sum(malebias), femalebias = sum(femalebias), total = malebias + femalebias,
label = "All traits", samplesize = sum(samplesize)) %>%
mutate(percent = ifelse(sex == "femalepercent", femalebias*100/(malebias+femalebias), malebias*100/(malebias+femalebias))) %>%
bind_rows(meta.plot2.all.e, .) %>%
mutate(rownumber = row_number()) %>%
.[c(37, 1:9, 39, 10:18, 38, 19:27, 40, 28:36), ]
binding factor and character vector, coercing into character vectorbinding character and factor vector, coercing into character vector
meta.plot2.all.f$GroupingTerm <- factor(meta.plot2.all.f$GroupingTerm, levels = c("Behaviour", "Morphology", "Metabolism", "Physiology", "Immunology", "Hematology", "Heart", "Hearing", "Eye", "All"))
meta.plot2.all.f$GroupingTerm <- factor(meta.plot2.all.f$GroupingTerm, rev(levels(meta.plot2.all.f$GroupingTerm)))
malebias_Fig2_alltraits <-
ggplot(meta.plot2.all.f) +
aes(x = GroupingTerm, y = percent, fill = sex) +
geom_col() +
geom_hline(yintercept = 50, linetype = "dashed", color = "gray40") +
geom_text(
data = subset(meta.plot2.all.f, samplesize != 0), aes(label = samplesize), position = position_stack(vjust = .5),
color = "white", size = 3.5
) +
facet_grid(
cols = vars(trait), rows = vars(label), labeller = label_wrap_gen(width = 18),
scales = "free", space = "free"
) +
scale_fill_brewer(palette = "Set2") +
theme_bw(base_size = 18) +
theme(
strip.text.y = element_text(angle = 270, size = 10, margin = margin(t = 15, r = 15, b = 15, l = 15)),
strip.text.x = element_text(size = 12),
strip.background = element_rect(colour = NULL, linetype = "blank", fill = "gray90"),
text = element_text(size = 14),
panel.spacing = unit(0.5, "lines"),
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major.x = element_line(linetype = "solid", colour = "gray95"),
panel.grid.major.y = element_line(linetype = "solid", color = "gray95"),
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.position = "none",
axis.title.x = element_blank(),
axis.title.y = element_blank()
) +
coord_flip()
# malebias_Fig2_alltraits #(panel A in Figure 4 in ms)
Data are restructured, and grouping terms are being re-ordered
overall3 <- gather(overall2, parameter, value, c(lnCVR, lnRR), factor_key = TRUE) # lnVR,
lnCVR.ci <- overall3 %>%
filter(parameter == "lnCVR") %>%
mutate(ci.low = lnCVR_lower, ci.high = lnCVR_upper)
lnVR.ci <- overall3 %>%
filter(parameter == "lnVR") %>%
mutate(ci.low = lnVR_lower, ci.high = lnVR_upper)
lnRR.ci <- overall3 %>%
filter(parameter == "lnRR") %>%
mutate(ci.low = lnRR_lower, ci.high = lnRR_upper)
overall4 <- bind_rows(lnCVR.ci, lnRR.ci) %>% select(GroupingTerm, parameter, value, ci.low, ci.high) # lnVR.ci,
# re-order Grouping Terms
overall4$GroupingTerm <- factor(overall4$GroupingTerm, levels = c("Behaviour", "Morphology", "Metabolism", "Physiology", "Immunology", "Hematology", "Heart", "Hearing", "Eye", "All"))
overall4$GroupingTerm <- factor(overall4$GroupingTerm, rev(levels(overall4$GroupingTerm)))
overall4$label <- "All traits"
kable(cbind(overall4, overall4)) %>%
kable_styling() %>%
scroll_box(width = "100%", height = "200px")
GroupingTerm | parameter | value | ci.low | ci.high | label | GroupingTerm | parameter | value | ci.low | ci.high | label |
---|---|---|---|---|---|---|---|---|---|---|---|
Behaviour | lnCVR | -0.0035049 | -0.0240688 | 0.0170591 | All traits | Behaviour | lnCVR | -0.0035049 | -0.0240688 | 0.0170591 | All traits |
Morphology | lnCVR | 0.0774453 | 0.0414171 | 0.1134734 | All traits | Morphology | lnCVR | 0.0774453 | 0.0414171 | 0.1134734 | All traits |
Metabolism | lnCVR | -0.0430831 | -0.1125945 | 0.0264283 | All traits | Metabolism | lnCVR | -0.0430831 | -0.1125945 | 0.0264283 | All traits |
Physiology | lnCVR | 0.0126792 | -0.0140094 | 0.0393678 | All traits | Physiology | lnCVR | 0.0126792 | -0.0140094 | 0.0393678 | All traits |
Immunology | lnCVR | -0.0681817 | -0.0980135 | -0.0383499 | All traits | Immunology | lnCVR | -0.0681817 | -0.0980135 | -0.0383499 | All traits |
Hematology | lnCVR | 0.0217865 | -0.0165045 | 0.0600776 | All traits | Hematology | lnCVR | 0.0217865 | -0.0165045 | 0.0600776 | All traits |
Heart | lnCVR | 0.0183839 | -0.0128375 | 0.0496053 | All traits | Heart | lnCVR | 0.0183839 | -0.0128375 | 0.0496053 | All traits |
Hearing | lnCVR | 0.0157302 | -0.0111999 | 0.0426603 | All traits | Hearing | lnCVR | 0.0157302 | -0.0111999 | 0.0426603 | All traits |
Eye | lnCVR | -0.0817932 | -0.1476821 | -0.0159043 | All traits | Eye | lnCVR | -0.0817932 | -0.1476821 | -0.0159043 | All traits |
All | lnCVR | 0.0046553 | -0.0086242 | 0.0179348 | All traits | All | lnCVR | 0.0046553 | -0.0086242 | 0.0179348 | All traits |
Behaviour | lnRR | -0.0199206 | -0.0634388 | 0.0235976 | All traits | Behaviour | lnRR | -0.0199206 | -0.0634388 | 0.0235976 | All traits |
Morphology | lnRR | 0.0678160 | 0.0072225 | 0.1284095 | All traits | Morphology | lnRR | 0.0678160 | 0.0072225 | 0.1284095 | All traits |
Metabolism | lnRR | 0.1422577 | 0.0364352 | 0.2480801 | All traits | Metabolism | lnRR | 0.1422577 | 0.0364352 | 0.2480801 | All traits |
Physiology | lnRR | 0.0163695 | -0.0443364 | 0.0770753 | All traits | Physiology | lnRR | 0.0163695 | -0.0443364 | 0.0770753 | All traits |
Immunology | lnRR | -0.0574840 | -0.1074213 | -0.0075466 | All traits | Immunology | lnRR | -0.0574840 | -0.1074213 | -0.0075466 | All traits |
Hematology | lnRR | 0.0388537 | -0.0024274 | 0.0801348 | All traits | Hematology | lnRR | 0.0388537 | -0.0024274 | 0.0801348 | All traits |
Heart | lnRR | -0.0048933 | -0.0324240 | 0.0226374 | All traits | Heart | lnRR | -0.0048933 | -0.0324240 | 0.0226374 | All traits |
Hearing | lnRR | -0.0132366 | -0.0335982 | 0.0071251 | All traits | Hearing | lnRR | -0.0132366 | -0.0335982 | 0.0071251 | All traits |
Eye | lnRR | 0.0091186 | 0.0012071 | 0.0170302 | All traits | Eye | lnRR | 0.0091186 | 0.0012071 | 0.0170302 | All traits |
All | lnRR | 0.0124332 | -0.0061474 | 0.0310138 | All traits | All | lnRR | 0.0124332 | -0.0061474 | 0.0310138 | All traits |
Metameta_Fig3_alltraits <- overall4 %>%
ggplot(aes(y = GroupingTerm, x = value)) +
geom_errorbarh(aes(
xmin = ci.low,
xmax = ci.high
),
height = 0.1, show.legend = FALSE
) +
geom_point(aes(shape = parameter),
fill = "black",
color = "black", size = 2.2,
show.legend = FALSE
) +
scale_x_continuous(
limits = c(-0.24, 0.25),
breaks = c(-0.2, -0.1, 0, 0.1, 0.2),
name = "Effect size"
) +
geom_vline(
xintercept = 0,
color = "black",
linetype = "dashed"
) +
facet_grid(
cols = vars(parameter), rows = vars(label),
labeller = label_wrap_gen(width = 23),
scales = "free",
space = "free"
) +
theme_bw() +
theme(
strip.text.y = element_text(angle = 270, size = 10, margin = margin(t = 15, r = 15, b = 15, l = 15)),
strip.text.x = element_text(size = 12),
strip.background = element_rect(colour = NULL, linetype = "blank", fill = "gray90"),
text = element_text(size = 14),
panel.spacing = unit(0.5, "lines"),
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major.x = element_line(linetype = "solid", colour = "gray95"),
panel.grid.major.y = element_line(linetype = "solid", color = "gray95"),
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.title = element_blank(),
axis.title.x = element_text(hjust = 0.5, size = 14),
axis.title.y = element_blank()
)
# Metameta_Fig3_alltraits
Join the different parts and #TO DO!! add M / F symbols in Metameta_Fig3_alltraits
#Test
#male <- readPNG(system.file("img", "male"))
#test <- Metameta_Fig3_alltraits
#library(png)
Fig4 <- ggarrange(malebias_Fig2_alltraits, Metameta_Fig3_alltraits, nrow = 2, align = "v", heights = c(1, 1), labels = c("A", "B"))
Fig4
Panel A shows the numbers of traits across functional groups that are either male-biased (blue-green) or female-biased (orange-red), as calculated in Step D (figure 3). Panel B shows effect sizes and 95% CI from separate meta-analysis for each functional group (step H in Figure 3). Both panels represent results evaluated across all traits (Phase 3, Figure 3). Traits that are male biased are Male data is shown in blue, whereas female bias data is represented in orange.
To further investigate sex bias in this dataset, and in particular if the extent of sex bias differs between traits, we investigate the magnitude of male- and female bias in significantly different traits on (both for means and variability)
To do this, we select only traits that have CIs that do not overlap with zero. ### FELIX: “ALL” missing. This figure is panel A in Fig 5
meta.plot2.sig <- meta_clean %>%
mutate(
lnCVRsig = ifelse(lnCVR_lower * lnCVR_upper > 0, 1, 0), lnVRsig = ifelse(lnVR_lower * lnVR_upper > 0, 1, 0),
lnRRsig = ifelse(lnRR_lower * lnRR_upper > 0, 1, 0)
)
meta.plot2.sig.b <- meta.plot2.sig[, c("lnCVR", "lnRR", "lnCVRsig", "lnVRsig", "lnRRsig", "GroupingTerm")] # "lnVR",
meta.plot2.sig.c <- gather(meta.plot2.sig.b, trait, value, lnCVR:lnRR)
meta.plot2.sig.c$sig <- "placeholder"
meta.plot2.sig.c$trait <- factor(meta.plot2.sig.c$trait, levels = c("lnCVR", "lnRR")) # "lnVR",
meta.plot2.sig.c$sig <- ifelse(meta.plot2.sig.c$trait == "lnCVR", meta.plot2.sig.c$lnCVRsig,
ifelse(meta.plot2.sig.c$trait == "lnVR", meta.plot2.sig.c$lnVRsig, meta.plot2.sig.c$lnRRsig)
)
# choosing sex biased ln-ratios significantly larger than 0
meta.plot2.sig.malebias <- meta.plot2.sig.c %>%
group_by_at(vars(trait, GroupingTerm)) %>%
filter(sig == 1) %>%
summarise(male_sig = sum(value > 0), female_sig = sum(value < 0), total = male_sig + female_sig)
meta.plot2.sig.malebias <- ungroup(meta.plot2.sig.malebias) %>%
add_row(trait = "lnCVR", GroupingTerm = "Hearing", male_sig = 0, female_sig = 0, .before = 4) %>% # add "Hearing" for lnCVR (not filtered as only zeros)
mutate(malepercent = male_sig * 100 / total, femalepercent = female_sig * 100 / total)
meta.plot2.sig.malebias$label <- "CI not overlapping zero"
# restructure to create stacked bar plots
meta.plot2.sig.bothsexes <- as.data.frame(meta.plot2.sig.malebias)
meta.plot2.sig.bothsexes.b <- gather(meta.plot2.sig.bothsexes, key = sex, value = percent, malepercent:femalepercent, factor_key = TRUE)
# create new sample size variable
meta.plot2.sig.bothsexes.b$samplesize <- with(meta.plot2.sig.bothsexes.b, ifelse(sex == "malepercent", male_sig, female_sig))
# Plot Fig2 all significant results (CI not overlapping zero):
# Several grouing terms are added post-hoc (with no data to display): no significant lnCVR for 'Hearing' in either sex; no sig. male-biased lnCVR for 'Immunology' and 'Eye, and no significant male-biased lnVR for 'Eye'.
malebias_Fig2_sigtraits <-
ggplot(meta.plot2.sig.bothsexes.b) +
aes(x = GroupingTerm, y = percent, fill = sex) +
geom_col() +
geom_hline(yintercept = 50, linetype = "dashed", color = "gray40") +
geom_text(
data = subset(meta.plot2.sig.bothsexes.b, samplesize != 0), aes(label = samplesize), position = position_stack(vjust = .5),
color = "white", size = 3.5
) +
facet_grid(
cols = vars(trait), rows = vars(label), labeller = label_wrap_gen(width = 18),
scales = "free", space = "free"
) +
scale_fill_brewer(palette = "Set2") +
theme_bw(base_size = 18) +
theme(
strip.text.y = element_text(angle = 270, size = 10, margin = margin(t = 15, r = 15, b = 15, l = 15)),
strip.text.x = element_text(size = 12),
strip.background = element_rect(colour = NULL, linetype = "blank", fill = "gray90"),
text = element_text(size = 14),
panel.spacing = unit(0.5, "lines"),
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major.x = element_line(linetype = "solid", colour = "gray95"),
panel.grid.major.y = element_line(linetype = "solid", color = "gray95"),
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.position = "none",
axis.title.x = element_blank(),
axis.title.y = element_blank()
) +
coord_flip()
Prepare data create column with 1= different from zero, 0= zero included in CI #### Male-biased (significant) traits
meta.male.plot3.sig <- metacombo %>%
mutate(
sigCVR = ifelse(lnCVR_lower > 0, 1, 0),
sigVR = ifelse(lnVR_lower > 0, 1, 0),
sigRR = ifelse(lnRR_lower > 0, 1, 0)
)
# Significant subset for lnCVR
metacombo_male.plot3.CVR <- meta.male.plot3.sig %>%
filter(sigCVR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_male.plot3.CVR.all <- meta.male.plot3.sig %>%
filter(sigCVR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# Significant subset for lnVR
metacombo_male.plot3.VR <- meta.male.plot3.sig %>%
filter(sigVR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_male.plot3.VR.all <- meta.male.plot3.sig %>%
filter(sigVR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# Significant subset for lnRR
metacombo_male.plot3.RR <- meta.male.plot3.sig %>%
filter(sigRR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_male.plot3.RR.all <- meta.male.plot3.sig %>%
filter(sigRR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# **Final fixed effects meta-analyses within grouping terms, with SE of the estimate
plot3.male.meta.CVR <- metacombo_male.plot3.CVR %>%
mutate(model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.VR <- metacombo_male.plot3.VR %>%
mutate(model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.RR <- metacombo_male.plot3.RR %>%
mutate(model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
# Across all grouping terms #
plot3.male.meta.CVR.all <- metacombo_male.plot3.CVR.all %>%
mutate(model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.CVR.all <- plot3.male.meta.CVR.all %>% mutate(GroupingTerm = "All")
plot3.male.meta.VR.all <- metacombo_male.plot3.VR.all %>%
mutate(model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.VR.all <- plot3.male.meta.VR.all %>% mutate(GroupingTerm = "All")
plot3.male.meta.RR.all <- metacombo_male.plot3.RR.all %>%
mutate(model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.RR.all <- plot3.male.meta.RR.all %>% mutate(GroupingTerm = "All")
# Combine with separate grouping term results
plot3.male.meta.CVR <- bind_rows(plot3.male.meta.CVR, plot3.male.meta.CVR.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
plot3.male.meta.VR <- bind_rows(plot3.male.meta.VR, plot3.male.meta.VR.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
plot3.male.meta.RR <- bind_rows(plot3.male.meta.RR, plot3.male.meta.RR.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
# **Re-structure data for each grouping term; delete un-used variables
plot3.male.meta.CVR.b <- as.data.frame(plot3.male.meta.CVR %>% group_by(GroupingTerm) %>%
mutate(
lnCVR = map_dbl(model_lnCVR, pluck(2)), lnCVR_lower = map_dbl(model_lnCVR, pluck(6)),
lnCVR_upper = map_dbl(model_lnCVR, pluck(7)), lnCVR_se = map_dbl(model_lnCVR, pluck(3))
))[, c(1, 4:7)]
add.row.hearing <- as.data.frame(t(c("Hearing", NA, NA, NA, NA))) %>% setNames(names(plot3.male.meta.CVR.b))
plot3.male.meta.CVR.b <- bind_rows(plot3.male.meta.CVR.b, add.row.hearing)
binding character and factor vector, coercing into character vector
plot3.male.meta.CVR.b <- plot3.male.meta.CVR.b[order(plot3.male.meta.CVR.b$GroupingTerm), ]
plot3.male.meta.VR.b <- as.data.frame(plot3.male.meta.VR %>% group_by(GroupingTerm) %>%
mutate(
lnVR = map_dbl(model_lnVR, pluck(2)), lnVR_lower = map_dbl(model_lnVR, pluck(6)),
lnVR_upper = map_dbl(model_lnVR, pluck(7)), lnVR_se = map_dbl(model_lnVR, pluck(3))
))[, c(1, 4:7)]
plot3.male.meta.VR.b <- plot3.male.meta.VR.b[order(plot3.male.meta.VR.b$GroupingTerm), ]
plot3.male.meta.RR.b <- as.data.frame(plot3.male.meta.RR %>% group_by(GroupingTerm) %>%
mutate(
lnRR = map_dbl(model_lnRR, pluck(2)), lnRR_lower = map_dbl(model_lnRR, pluck(6)),
lnRR_upper = map_dbl(model_lnRR, pluck(7)), lnRR_se = map_dbl(model_lnRR, pluck(3))
))[, c(1, 4:7)]
plot3.male.meta.RR.b <- plot3.male.meta.RR.b[order(plot3.male.meta.RR.b$GroupingTerm), ]
overall.male.plot3 <- full_join(plot3.male.meta.CVR.b, plot3.male.meta.VR.b)
Joining, by = "GroupingTerm"
overall.male.plot3 <- full_join(overall.male.plot3, plot3.male.meta.RR.b)
Joining, by = "GroupingTerm"
overall.male.plot3$GroupingTerm <- factor(overall.male.plot3$GroupingTerm, levels = c("Behaviour", "Morphology", "Metabolism", "Physiology", "Immunology", "Hematology", "Heart", "Hearing", "Eye", "All"))
overall.male.plot3$GroupingTerm <- factor(overall.male.plot3$GroupingTerm, rev(levels(overall.male.plot3$GroupingTerm)))
# add missing GroupingTerms for plot
overall.male.plot3 <- add_row(overall.male.plot3, GroupingTerm = "Behaviour")
overall.male.plot3 <- add_row(overall.male.plot3, GroupingTerm = "Immunology")
overall.male.plot3 <- add_row(overall.male.plot3, GroupingTerm = "Eye")
overall.male.plot3$GroupingTerm <- factor(overall.male.plot3$GroupingTerm, levels = c("Behaviour", "Morphology", "Metabolism", "Physiology", "Immunology", "Hematology", "Heart", "Hearing", "Eye", "All"))
overall.male.plot3$GroupingTerm <- factor(overall.male.plot3$GroupingTerm, rev(levels(overall.male.plot3$GroupingTerm)))
# str(overall.male.plot3)
Restructure MALE data for plotting
overall3.male.sig <- gather(overall.male.plot3, parameter, value, c(lnCVR, lnRR), factor_key = TRUE) # lnVR,
lnCVR.ci <- overall3.male.sig %>%
filter(parameter == "lnCVR") %>%
mutate(ci.low = lnCVR_lower, ci.high = lnCVR_upper)
# lnVR.ci <- overall3.male.sig %>% filter(parameter == "lnVR") %>% mutate(ci.low = lnVR_lower, ci.high = lnVR_upper)
lnRR.ci <- overall3.male.sig %>%
filter(parameter == "lnRR") %>%
mutate(ci.low = lnRR_lower, ci.high = lnRR_upper)
overall4.male.sig <- bind_rows(lnCVR.ci, lnRR.ci) %>% select(GroupingTerm, parameter, value, ci.low, ci.high) # lnVR.ci,
overall4.male.sig$label <- "CI not overlapping zero"
Plot Fig5b all significant results (CI not overlapping zero) for males
Metameta_Fig3_male.sig <- overall4.male.sig %>%
ggplot(aes(y = GroupingTerm, x = value)) +
geom_errorbarh(aes(
xmin = ci.low,
xmax = ci.high
),
height = 0.1, show.legend = FALSE
) +
geom_point(aes(shape = parameter),
fill = "mediumaquamarine", color = "mediumaquamarine", size = 2.2,
show.legend = FALSE
) +
scale_x_continuous(
limits = c(0, 0.4),
breaks = c(0, 0.3),
name = "Effect size"
) +
geom_vline(
xintercept = 0,
color = "black",
linetype = "dashed"
) +
facet_grid(
cols = vars(parameter), rows = vars(label),
labeller = label_wrap_gen(width = 23),
scales = "free",
space = "free"
) +
theme_bw() +
theme(
strip.text.y = element_text(angle = 270, size = 10, margin = margin(t = 15, r = 15, b = 15, l = 15)),
strip.text.x = element_text(size = 12),
strip.background = element_rect(colour = NULL, linetype = "blank", fill = "gray90"),
text = element_text(size = 14),
panel.spacing = unit(0.5, "lines"),
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major.x = element_line(linetype = "solid", colour = "gray95"),
panel.grid.major.y = element_line(linetype = "solid", color = "gray95"),
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.title = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank()
)
# Metameta_Fig3_male.sig
Female Fig5B sig
Prepare data for traits with CI not overlapping 0 create column with 1= different from zero, 0= zero included in CI
# female-biased traits
meta.female.plot3.sig <- metacombo %>%
mutate(
sigCVR = ifelse(lnCVR_upper < 0, 1, 0),
sigVR = ifelse(lnVR_upper < 0, 1, 0),
sigRR = ifelse(lnRR_upper < 0, 1, 0)
)
# Significant subset for lnCVR
metacombo_female.plot3.CVR <- meta.female.plot3.sig %>%
filter(sigCVR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_female.plot3.CVR.all <- meta.female.plot3.sig %>%
filter(sigCVR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# Significant subset for lnVR
metacombo_female.plot3.VR <- meta.female.plot3.sig %>%
filter(sigVR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_female.plot3.VR.all <- meta.female.plot3.sig %>%
filter(sigVR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# Significant subset for lnRR
metacombo_female.plot3.RR <- meta.female.plot3.sig %>%
filter(sigRR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_female.plot3.RR.all <- meta.female.plot3.sig %>%
filter(sigRR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# **Final fixed effects meta-analyses within grouping terms, with SE of the estimate
plot3.female.meta.CVR <- metacombo_female.plot3.CVR %>%
mutate(model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.female.meta.VR <- metacombo_female.plot3.VR %>%
mutate(model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.female.meta.RR <- metacombo_female.plot3.RR %>%
mutate(model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
# Across all grouping terms #
plot3.female.meta.CVR.all <- metacombo_female.plot3.CVR.all %>%
mutate(model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.female.meta.CVR.all <- plot3.female.meta.CVR.all %>% mutate(GroupingTerm = "All")
plot3.female.meta.VR.all <- metacombo_female.plot3.VR.all %>%
mutate(model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.female.meta.VR.all <- plot3.female.meta.VR.all %>% mutate(GroupingTerm = "All")
plot3.female.meta.RR.all <- metacombo_female.plot3.RR.all %>%
mutate(model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.female.meta.RR.all <- plot3.female.meta.RR.all %>% mutate(GroupingTerm = "All")
# Combine with separate grouping term results
plot3.female.meta.CVR <- bind_rows(plot3.female.meta.CVR, plot3.female.meta.CVR.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
plot3.female.meta.VR <- bind_rows(plot3.female.meta.VR, plot3.female.meta.VR.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
plot3.female.meta.RR <- bind_rows(plot3.female.meta.RR, plot3.female.meta.RR.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
# **Re-structure data for each grouping term; delete un-used variables
plot3.female.meta.CVR.b <- as.data.frame(plot3.female.meta.CVR %>% group_by(GroupingTerm) %>%
mutate(
lnCVR = map_dbl(model_lnCVR, pluck(2)), lnCVR_lower = map_dbl(model_lnCVR, pluck(6)),
lnCVR_upper = map_dbl(model_lnCVR, pluck(7)), lnCVR_se = map_dbl(model_lnCVR, pluck(3))
))[, c(1, 4:7)]
add.row.hearing <- as.data.frame(t(c("Hearing", NA, NA, NA, NA))) %>% setNames(names(plot3.female.meta.CVR.b))
plot3.female.meta.CVR.b <- bind_rows(plot3.female.meta.CVR.b, add.row.hearing)
binding character and factor vector, coercing into character vector
plot3.female.meta.CVR.b <- plot3.female.meta.CVR.b[order(plot3.female.meta.CVR.b$GroupingTerm), ]
plot3.female.meta.VR.b <- as.data.frame(plot3.female.meta.VR %>% group_by(GroupingTerm) %>%
mutate(
lnVR = map_dbl(model_lnVR, pluck(2)), lnVR_lower = map_dbl(model_lnVR, pluck(6)),
lnVR_upper = map_dbl(model_lnVR, pluck(7)), lnVR_se = map_dbl(model_lnVR, pluck(3))
))[, c(1, 4:7)]
plot3.female.meta.VR.b <- plot3.female.meta.VR.b[order(plot3.female.meta.VR.b$GroupingTerm), ]
plot3.female.meta.RR.b <- as.data.frame(plot3.female.meta.RR %>% group_by(GroupingTerm) %>%
mutate(
lnRR = map_dbl(model_lnRR, pluck(2)), lnRR_lower = map_dbl(model_lnRR, pluck(6)),
lnRR_upper = map_dbl(model_lnRR, pluck(7)), lnRR_se = map_dbl(model_lnRR, pluck(3))
))[, c(1, 4:7)]
plot3.female.meta.RR.b <- plot3.female.meta.RR.b[order(plot3.female.meta.RR.b$GroupingTerm), ]
overall.female.plot3 <- full_join(plot3.female.meta.CVR.b, plot3.female.meta.VR.b)
Joining, by = "GroupingTerm"
overall.female.plot3 <- full_join(overall.female.plot3, plot3.female.meta.RR.b)
Joining, by = "GroupingTerm"
overall.female.plot3$GroupingTerm <- factor(overall.female.plot3$GroupingTerm, levels = c("Behaviour", "Morphology", "Metabolism", "Physiology", "Immunology", "Hematology", "Heart", "Hearing", "Eye", "All"))
overall.female.plot3$GroupingTerm <- factor(overall.female.plot3$GroupingTerm, rev(levels(overall.female.plot3$GroupingTerm)))
Restructure data for plotting
overall3.female.sig <- gather(overall.female.plot3, parameter, value, c(lnCVR, lnRR), factor_key = TRUE) # lnVR,
lnCVR.ci <- overall3.female.sig %>%
filter(parameter == "lnCVR") %>%
mutate(ci.low = lnCVR_lower, ci.high = lnCVR_upper)
# lnVR.ci <- overall3.female.sig %>% filter(parameter == "lnVR") %>% mutate(ci.low = lnVR_lower, ci.high = lnVR_upper)
lnRR.ci <- overall3.female.sig %>%
filter(parameter == "lnRR") %>%
mutate(ci.low = lnRR_lower, ci.high = lnRR_upper)
overall4.female.sig <- bind_rows(lnCVR.ci, lnRR.ci) %>% select(GroupingTerm, parameter, value, ci.low, ci.high) # lnVR.ci,
overall4.female.sig$label <- "CI not overlapping zero"
Plotting Fig5B all significant results (CI not overlapping zero, female )
Metameta_Fig3_female.sig <- overall4.female.sig %>%
ggplot(aes(y = GroupingTerm, x = value)) +
geom_errorbarh(aes(
xmin = ci.low,
xmax = ci.high
),
height = 0.1, show.legend = FALSE
) +
geom_point(aes(shape = parameter),
fill = "salmon1", color = "salmon1", size = 2.2,
show.legend = FALSE
) +
scale_x_continuous(
limits = c(-0.4, 0),
breaks = c(-0.3, 0),
name = "Effect size"
) +
geom_vline(
xintercept = 0,
color = "black",
linetype = "dashed"
) +
facet_grid(
cols = vars(parameter), # rows = vars(label),
# labeller = label_wrap_gen(width = 23),
scales = "free",
space = "free"
) +
theme_bw() +
theme(
strip.text.y = element_text(angle = 270, size = 10, margin = margin(t = 15, r = 15, b = 15, l = 15)),
strip.text.x = element_text(size = 12),
strip.background = element_rect(colour = NULL, linetype = "blank", fill = "gray90"),
text = element_text(size = 14),
panel.spacing = unit(0.5, "lines"),
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major.x = element_line(linetype = "solid", colour = "gray95"),
panel.grid.major.y = element_line(linetype = "solid", color = "gray95"),
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.title = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank()
)
# Metameta_Fig3_female.sig #(Figure 5B left panel)
# *Prepare data for all traits
meta.plot2.all <- meta_clean %>%
select(lnCVR, lnVR, lnRR, GroupingTerm) %>%
arrange(GroupingTerm)
meta.plot2.all.bS1 <- gather(meta.plot2.all, trait, value, c(lnCVR, lnVR, lnRR))
meta.plot2.all.bS1$trait <- factor(meta.plot2.all.bS1$trait, levels = c("lnCVR", "lnVR", "lnRR"))
meta.plot2.all.cS1 <- meta.plot2.all.bS1 %>%
group_by_at(vars(trait, GroupingTerm)) %>%
summarise(
malebias = sum(value > 0), femalebias = sum(value <= 0), total = malebias + femalebias,
malepercent = malebias * 100 / total, femalepercent = femalebias * 100 / total
)
meta.plot2.all.cS1$label <- "All traits"
# restructure to create stacked bar plots
meta.plot2.all.dS1 <- as.data.frame(meta.plot2.all.cS1)
meta.plot2.all.eS1 <- gather(meta.plot2.all.dS1, key = sex, value = percent, malepercent:femalepercent, factor_key = TRUE)
# create new sample size variable
meta.plot2.all.eS1$samplesize <- with(meta.plot2.all.eS1, ifelse(sex == "malepercent", malebias, femalebias))
malebias_FigS1_alltraits <-
ggplot(meta.plot2.all.eS1) +
aes(x = GroupingTerm, y = percent, fill = sex) +
geom_col() +
geom_hline(yintercept = 50, linetype = "dashed", color = "gray40") +
geom_text(
data = subset(meta.plot2.all.eS1, samplesize != 0), aes(label = samplesize), position = position_stack(vjust = .5),
color = "white", size = 3.5
) +
facet_grid(
cols = vars(trait), rows = vars(label), labeller = label_wrap_gen(width = 18),
scales = "free", space = "free"
) +
scale_fill_brewer(palette = "Set2") +
theme_bw(base_size = 18) +
theme(
strip.text.y = element_text(angle = 270, size = 10, margin = margin(t = 15, r = 15, b = 15, l = 15)),
strip.text.x = element_text(size = 12),
strip.background = element_rect(colour = NULL, linetype = "blank", fill = "gray90"),
text = element_text(size = 14),
panel.spacing = unit(0.5, "lines"),
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major.x = element_line(linetype = "solid", colour = "gray95"),
panel.grid.major.y = element_line(linetype = "solid", color = "gray95"),
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.position = "none",
axis.title.x = element_blank(),
axis.title.y = element_blank()
) +
coord_flip()
# malebias_FigS1_alltraits #(panel A in Figure S1)
Restructure MALE data for plotting
overall3.male.sigS <- gather(overall.male.plot3, parameter, value, c(lnCVR, lnVR, lnRR), factor_key = TRUE)
lnCVR.ci <- overall3.male.sigS %>%
filter(parameter == "lnCVR") %>%
mutate(ci.low = lnCVR_lower, ci.high = lnCVR_upper)
lnVR.ci <- overall3.male.sigS %>%
filter(parameter == "lnVR") %>%
mutate(ci.low = lnVR_lower, ci.high = lnVR_upper)
lnRR.ci <- overall3.male.sigS %>%
filter(parameter == "lnRR") %>%
mutate(ci.low = lnRR_lower, ci.high = lnRR_upper)
overall4.male.sigS <- bind_rows(lnCVR.ci, lnVR.ci, lnRR.ci) %>% select(GroupingTerm, parameter, value, ci.low, ci.high)
overall4.male.sigS$label <- "CI not overlapping zero"
# Data are restructured, and grouping terms are being re-ordered
overall3S <- gather(overall2, parameter, value, c(lnCVR, lnVR, lnRR), factor_key = TRUE)
lnCVR.ci <- overall3S %>%
filter(parameter == "lnCVR") %>%
mutate(ci.low = lnCVR_lower, ci.high = lnCVR_upper)
lnVR.ci <- overall3S %>%
filter(parameter == "lnVR") %>%
mutate(ci.low = lnVR_lower, ci.high = lnVR_upper)
lnRR.ci <- overall3S %>%
filter(parameter == "lnRR") %>%
mutate(ci.low = lnRR_lower, ci.high = lnRR_upper)
overall4S <- bind_rows(lnCVR.ci, lnVR.ci, lnRR.ci) %>% select(GroupingTerm, parameter, value, ci.low, ci.high)
# re-order Grouping Terms
overall4S$GroupingTerm <- factor(overall4S$GroupingTerm, levels = c("Behaviour", "Morphology", "Metabolism", "Physiology", "Immunology", "Hematology", "Heart", "Hearing", "Eye", "All"))
overall4S$GroupingTerm <- factor(overall4S$GroupingTerm, rev(levels(overall4S$GroupingTerm)))
overall4S$label <- "All traits"
Preparation: Sub-Plot for Figure S1: all traits (S1 B)
Metameta_FigS1_alltraits <- overall4S %>%
ggplot(aes(y = GroupingTerm, x = value)) +
geom_errorbarh(aes(
xmin = ci.low,
xmax = ci.high
),
height = 0.1, show.legend = FALSE
) +
geom_point(aes(shape = parameter),
fill = "black",
color = "black", size = 2.2,
show.legend = FALSE
) +
scale_x_continuous(
limits = c(-0.24, 0.25),
breaks = c(-0.2, -0.1, 0, 0.1, 0.2),
name = "Effect size"
) +
geom_vline(
xintercept = 0,
color = "black",
linetype = "dashed"
) +
facet_grid(
cols = vars(parameter), rows = vars(label),
labeller = label_wrap_gen(width = 23),
scales = "free",
space = "free"
) +
theme_bw() +
theme(
strip.text.y = element_text(angle = 270, size = 10, margin = margin(t = 15, r = 15, b = 15, l = 15)),
strip.text.x = element_text(size = 12),
strip.background = element_rect(colour = NULL, linetype = "blank", fill = "gray90"),
text = element_text(size = 14),
panel.spacing = unit(0.5, "lines"),
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major.x = element_line(linetype = "solid", colour = "gray95"),
panel.grid.major.y = element_line(linetype = "solid", color = "gray95"),
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.title = element_blank(),
axis.title.x = element_text(hjust = 0.5, size = 14),
axis.title.y = element_blank()
)
# Metameta_FigS1_alltraits
The analysis for heterogeneity follows the workflow of the above steps for the different meta-analyses. However, in the initial meta-analysis we extract sigma^2 and errors for mouse strains and centers (Institutions).
results.allhetero.grouping <- as.data.frame(cbind(c(1:n), matrix(rep(0, n * 30), ncol = 30)))
names(results.allhetero.grouping) <- c(
"id", "sigma2_strain.CVR", "sigma2_center.CVR", "sigma2_error.CVR", "s.nlevels.strain.CVR",
"s.nlevels.center.CVR", "s.nlevels.error.CVR", "sigma2_strain.VR", "sigma2_center.VR", "sigma2_error.VR", "s.nlevels.strain.VR",
"s.nlevels.center.VR", "s.nlevels.error.VR", "sigma2_strain.RR", "sigma2_center.RR", "sigma2_error.RR", "s.nlevels.strain.RR",
"s.nlevels.center.RR", "s.nlevels.error.RR", "lnCVR", "lnCVR_lower", "lnCVR_upper", "lnCVR_se", "lnVR", "lnVR_lower", "lnVR_upper",
"lnVR_se", "lnRR", "lnRR_lower", "lnRR_upper", "lnRR_se"
)
LOOP Parameters to extract from metafor (sigma2’s, s.nlevels)
for (t in 1:n) {
tryCatch(
{
data_par_age <- data_subset_parameterid_individual_by_age(data, t, age_min = 0, age_center = 100)
population_stats <- calculate_population_stats(data_par_age)
results <- create_meta_analysis_effect_sizes(population_stats)
# lnCVR, logaritm of the ratio of male and female coefficients of variance
cvr. <- metafor::rma.mv(yi = effect_size_CVR, V = sample_variance_CVR, random = list(
~ 1 | strain_name, ~ 1 | production_center,
~ 1 | err
), control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), data = results)
results.allhetero.grouping[t, 2] <- cvr.$sigma2[1]
results.allhetero.grouping[t, 3] <- cvr.$sigma2[2]
results.allhetero.grouping[t, 4] <- cvr.$sigma2[3]
results.allhetero.grouping[t, 5] <- cvr.$s.nlevels[1]
results.allhetero.grouping[t, 6] <- cvr.$s.nlevels[2]
results.allhetero.grouping[t, 7] <- cvr.$s.nlevels[3]
results.allhetero.grouping[t, 20] <- cvr.$b
results.allhetero.grouping[t, 21] <- cvr.$ci.lb
results.allhetero.grouping[t, 22] <- cvr.$ci.ub
results.allhetero.grouping[t, 23] <- cvr.$se
# lnVR, male to female variability ratio (logarithm of male and female standard deviations)
vr. <- metafor::rma.mv(yi = effect_size_VR, V = sample_variance_VR, random = list(
~ 1 | strain_name, ~ 1 | production_center,
~ 1 | err
), control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), data = results)
results.allhetero.grouping[t, 8] <- vr.$sigma2[1]
results.allhetero.grouping[t, 9] <- vr.$sigma2[2]
results.allhetero.grouping[t, 10] <- vr.$sigma2[3]
results.allhetero.grouping[t, 11] <- vr.$s.nlevels[1]
results.allhetero.grouping[t, 12] <- vr.$s.nlevels[2]
results.allhetero.grouping[t, 13] <- vr.$s.nlevels[3]
results.allhetero.grouping[t, 24] <- vr.$b
results.allhetero.grouping[t, 25] <- vr.$ci.lb
results.allhetero.grouping[t, 26] <- vr.$ci.ub
results.allhetero.grouping[t, 27] <- vr.$se
# lnRR, response ratio (logarithm of male and female means)
rr. <- metafor::rma.mv(yi = effect_size_RR, V = sample_variance_RR, random = list(
~ 1 | strain_name, ~ 1 | production_center,
~ 1 | err
), control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), data = results)
results.allhetero.grouping[t, 14] <- rr.$sigma2[1]
results.allhetero.grouping[t, 15] <- rr.$sigma2[2]
results.allhetero.grouping[t, 16] <- rr.$sigma2[3]
results.allhetero.grouping[t, 17] <- rr.$s.nlevels[1]
results.allhetero.grouping[t, 18] <- rr.$s.nlevels[2]
results.allhetero.grouping[t, 19] <- rr.$s.nlevels[3]
results.allhetero.grouping[t, 28] <- rr.$b
results.allhetero.grouping[t, 29] <- rr.$ci.lb
results.allhetero.grouping[t, 30] <- rr.$ci.ub
results.allhetero.grouping[t, 31] <- rr.$se
},
error = function(e) {
cat("ERROR :", conditionMessage(e), "\n")
}
)
}
ERROR : Optimizer (optim) did not achieve convergence (convergence = 10).
Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.There are outcomes with non-positive sampling variances.'V' appears to be not positive definite.
ERROR : Optimizer (optim) did not achieve convergence (convergence = 10).
Rows with NAs omitted from model fitting.
ERROR : NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.
ERROR : NA/NaN/Inf in 'y'
Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.There are outcomes with non-positive sampling variances.'V' appears to be not positive definite.Rows with NAs omitted from model fitting.
ERROR : NA/NaN/Inf in 'y'
Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Single-level factor(s) found in 'random' argument. Corresponding 'sigma2' value(s) fixed to 0.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.There are outcomes with non-positive sampling variances.'V' appears to be not positive definite.Rows with NAs omitted from model fitting.Rows with NAs omitted from model fitting.There are outcomes with non-positive sampling variances.'V' appears to be not positive definite.Rows with NAs omitted from model fitting.
ERROR : NA/NaN/Inf in 'y'
results.allhetero.grouping2 <- results.allhetero.grouping[results.allhetero.grouping$s.nlevels.strain.VR != 0, ]
# nrow(results.allhetero.grouping2) #218 SZ 223???
Merge data sets containing metafor results with procedure etc. names
# procedures <- read.csv(here("export", "procedures.csv"))
results.allhetero.grouping2$parameter_group <- data$parameter_group[match(results.allhetero.grouping2$id, data$id)]
results.allhetero.grouping2$procedure <- data$procedure_name[match(results.allhetero.grouping2$id, data$id)]
results.allhetero.grouping2$GroupingTerm <- procedures$GroupingTerm[match(results.allhetero.grouping2$procedure, procedures$procedure)]
results.allhetero.grouping2$parameter_name <- data$parameter_name[match(results.allhetero.grouping2$id, data$id)]
## Perform meta-meta-analysis (3 for each of the 9 grouping terms: var.CVR, var.VR, var.RR)
metacombohetero_final <- metacombohetero %>%
group_by(GroupingTerm) %>%
nest()
Error in eval(lhs, parent, parent) : object 'metacombohetero' not found
Restructure data for plotting
HeteroS1
Error: object 'HeteroS1' not found
Plot FigS2 all significant results (CI not overlapping zero) for males ### FELIX: “ALL” missing.
This Figure extends Figure 4, as it includes results not only for lnCVR and lnRR but also lnCVR. In addition, we compare two different assessments of sex-bias, significance (CI not overlapping zero) and sex differences in male / female ratios > 10%
meta.plot2.over10 <- meta_clean %>%
select(lnCVR, lnVR, lnRR, GroupingTerm) %>%
arrange(GroupingTerm)
meta.plot2.over10.b <- gather(meta.plot2.over10, trait, value, c(lnCVR, lnVR, lnRR))
meta.plot2.over10.b$trait <- factor(meta.plot2.over10.b$trait, levels = c("lnCVR", "lnVR", "lnRR"))
meta.plot2.over10.c <- meta.plot2.over10.b %>%
group_by_at(vars(trait, GroupingTerm)) %>%
summarise(
malebias = sum(value > log(11 / 10)), femalebias = sum(value < log(9 / 10)), total = malebias + femalebias,
malepercent = malebias * 100 / total, femalepercent = femalebias * 100 / total
)
meta.plot2.over10.c$label <- "Sex difference in m/f ratios > 10%"
# restructure to create stacked bar plots
meta.plot2.over10.c <- as.data.frame(meta.plot2.over10.c)
meta.plot2.over10.d <- gather(meta.plot2.over10.c, key = sex, value = percent, malepercent:femalepercent, factor_key = TRUE)
# create new sample size variable
meta.plot2.over10.d$samplesize <- with(meta.plot2.over10.d, ifelse(sex == "malepercent", malebias, femalebias))
# *Plot Fig2 Sex difference in m/f ratio > 10%
malebias_Fig2_over10 <-
ggplot(meta.plot2.over10.d) +
aes(x = GroupingTerm, y = percent, fill = sex) +
geom_col() +
geom_hline(yintercept = 50, linetype = "dashed", color = "gray40") +
geom_text(
data = subset(meta.plot2.over10.d, samplesize != 0), aes(label = samplesize), position = position_stack(vjust = .5),
color = "white", size = 3.5
) +
facet_grid(
cols = vars(trait), rows = vars(label), labeller = label_wrap_gen(width = 18),
scales = "free", space = "free"
) +
scale_fill_brewer(palette = "Set2") +
theme_bw(base_size = 18) +
theme(
strip.text.y = element_text(angle = 270, size = 10, margin = margin(t = 15, r = 15, b = 15, l = 15)),
strip.text.x = element_blank(),
strip.background = element_rect(colour = NULL, linetype = "blank", fill = "gray90"),
text = element_text(size = 14),
panel.spacing = unit(0.5, "lines"),
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major.x = element_line(linetype = "solid", colour = "gray95"),
panel.grid.major.y = element_line(linetype = "solid", color = "gray95"),
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.position = "none",
axis.title.x = element_blank(),
axis.title.y = element_blank()
) +
coord_flip()
# malebias_Fig2_over10 (supplemental Figure S2)
Female FigS2 B sig
Prepare data for traits with CI not overlapping 0 create column with 1= different from zero, 0= zero included in CI
Restructure data for plotting
Prepare data for traits with m/f difference > 10%
Create column with 1= larger, 0= difference not larger than 10% between male/female ratios
meta.male.plot3.perc <- metacombo %>%
mutate(
percCVR = ifelse(lnCVR > log(11 / 10), 1, 0),
percVR = ifelse(lnVR > log(11 / 10), 1, 0),
percRR = ifelse(lnRR > log(11 / 10), 1, 0)
)
# Significant subset for lnCVR
metacombo_male.plot3.CVR.perc <- meta.male.plot3.perc %>%
filter(percCVR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_male.plot3.CVR.perc.all <- meta.male.plot3.perc %>%
filter(percCVR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# Significant subset for lnVR
metacombo_male.plot3.VR.perc <- meta.male.plot3.perc %>%
filter(percVR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_male.plot3.VR.perc.all <- meta.male.plot3.perc %>%
filter(percVR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# Significant subset for lnRR
metacombo_male.plot3.RR.perc <- meta.male.plot3.perc %>%
filter(percRR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_male.plot3.RR.perc.all <- meta.male.plot3.perc %>%
filter(percRR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# **Final fixed effects meta-analyses within grouping terms and across grouping terms, with SE of the estimate
plot3.male.meta.CVR.perc <- metacombo_male.plot3.CVR.perc %>%
mutate(model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.VR.perc <- metacombo_male.plot3.VR.perc %>%
mutate(model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.RR.perc <- metacombo_male.plot3.RR.perc %>%
mutate(model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
# Across all grouping terms #
plot3.male.meta.CVR.perc.all <- metacombo_male.plot3.CVR.perc.all %>%
mutate(model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.CVR.perc.all <- plot3.male.meta.CVR.perc.all %>% mutate(GroupingTerm = "All")
plot3.male.meta.VR.perc.all <- metacombo_male.plot3.VR.perc.all %>%
mutate(model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.VR.perc.all <- plot3.male.meta.VR.perc.all %>% mutate(GroupingTerm = "All")
plot3.male.meta.RR.perc.all <- metacombo_male.plot3.RR.perc.all %>%
mutate(model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.male.meta.RR.perc.all <- plot3.male.meta.RR.perc.all %>% mutate(GroupingTerm = "All")
# Combine with separate grouping term results
plot3.male.meta.CVR.perc <- bind_rows(plot3.male.meta.CVR.perc, plot3.male.meta.CVR.perc.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
plot3.male.meta.VR.perc <- bind_rows(plot3.male.meta.VR.perc, plot3.male.meta.VR.perc.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
plot3.male.meta.RR.perc <- bind_rows(plot3.male.meta.RR.perc, plot3.male.meta.RR.perc.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
# **Re-structure data for each grouping term; delete un-used variables: "Hearing missing for all 3 parameters"
plot3.male.meta.CVR.perc.b <- as.data.frame(plot3.male.meta.CVR.perc %>% group_by(GroupingTerm) %>%
mutate(
lnCVR = map_dbl(model_lnCVR, pluck(2)), lnCVR_lower = map_dbl(model_lnCVR, pluck(6)),
lnCVR_upper = map_dbl(model_lnCVR, pluck(7)), lnCVR_se = map_dbl(model_lnCVR, pluck(3))
))[, c(1, 4:7)]
add.row.hearing <- as.data.frame(t(c("Hearing", NA, NA, NA, NA))) %>% setNames(names(plot3.male.meta.CVR.perc.b))
plot3.male.meta.CVR.perc.b <- rbind(plot3.male.meta.CVR.perc.b, add.row.hearing)
plot3.male.meta.CVR.perc.b <- plot3.male.meta.CVR.perc.b[order(plot3.male.meta.CVR.perc.b$GroupingTerm), ]
plot3.male.meta.VR.perc.b <- as.data.frame(plot3.male.meta.VR.perc %>% group_by(GroupingTerm) %>%
mutate(
lnVR = map_dbl(model_lnVR, pluck(2)), lnVR_lower = map_dbl(model_lnVR, pluck(6)),
lnVR_upper = map_dbl(model_lnVR, pluck(7)), lnVR_se = map_dbl(model_lnVR, pluck(3))
))[, c(1, 4:7)]
add.row.hearing <- as.data.frame(t(c("Hearing", NA, NA, NA, NA))) %>% setNames(names(plot3.male.meta.VR.perc.b))
plot3.male.meta.VR.perc.b <- rbind(plot3.male.meta.VR.perc.b, add.row.hearing)
plot3.male.meta.VR.perc.b <- plot3.male.meta.VR.perc.b[order(plot3.male.meta.VR.perc.b$GroupingTerm), ]
plot3.male.meta.RR.perc.b <- as.data.frame(plot3.male.meta.RR.perc %>% group_by(GroupingTerm) %>%
mutate(
lnRR = map_dbl(model_lnRR, pluck(2)), lnRR_lower = map_dbl(model_lnRR, pluck(6)),
lnRR_upper = map_dbl(model_lnRR, pluck(7)), lnRR_se = map_dbl(model_lnRR, pluck(3))
))[, c(1, 4:7)]
add.row.hearing <- as.data.frame(t(c("Hearing", NA, NA, NA, NA))) %>%
setNames(names(plot3.male.meta.RR.perc.b))
plot3.male.meta.RR.perc.b <- rbind(plot3.male.meta.RR.perc.b, add.row.hearing)
add.row.eye <- as.data.frame(t(c("Eye", NA, NA, NA, NA))) %>%
setNames(names(plot3.male.meta.RR.perc.b))
plot3.male.meta.RR.perc.b <- rbind(plot3.male.meta.RR.perc.b, add.row.eye)
plot3.male.meta.RR.perc.b <- plot3.male.meta.RR.perc.b[order(plot3.male.meta.RR.perc.b$GroupingTerm), ]
plot3.male.meta.CVR.Vr.perc <- full_join(plot3.male.meta.CVR.perc.b, plot3.male.meta.VR.perc.b)
Joining, by = "GroupingTerm"
overall.male.plot3.perc <- full_join(plot3.male.meta.CVR.Vr.perc, plot3.male.meta.RR.perc.b)
Joining, by = "GroupingTerm"
overall.male.plot3.perc$GroupingTerm <- factor(overall.male.plot3.perc$GroupingTerm, levels = c("Behaviour", "Morphology", "Metabolism", "Physiology", "Immunology", "Hematology", "Heart", "Hearing", "Eye", "All"))
overall.male.plot3.perc$GroupingTerm <- factor(overall.male.plot3.perc$GroupingTerm, rev(levels(overall.male.plot3.perc$GroupingTerm)))
Restructure data for plotting : Male biased, 10% difference
overall3.perc <- gather(overall.male.plot3.perc, parameter, value, c(lnCVR, lnVR, lnRR), factor_key = TRUE)
lnCVR.ci <- overall3.perc %>%
filter(parameter == "lnCVR") %>%
mutate(ci.low = lnCVR_lower, ci.high = lnCVR_upper)
lnVR.ci <- overall3.perc %>% filter(parameter == "lnVR") %>% mutate(ci.low = lnVR_lower, ci.high = lnVR_upper)
lnRR.ci <- overall3.perc %>%
filter(parameter == "lnRR") %>%
mutate(ci.low = lnRR_lower, ci.high = lnRR_upper)
overall4.male.perc <- bind_rows(lnCVR.ci,lnVR.ci, lnRR.ci) %>% select(GroupingTerm, parameter, value, ci.low, ci.high)
overall4.male.perc$label <- "Sex difference in m/f ratios > 10%"
overall4.male.perc$value <- as.numeric(overall4.male.perc$value)
overall4.male.perc$ci.low <- as.numeric(overall4.male.perc$ci.low)
overall4.male.perc$ci.high <- as.numeric(overall4.male.perc$ci.high)
Plot Fig S2 all >10% difference (male bias)
meta.plot3.perc <- metacombo %>%
mutate(
percCVR = ifelse(lnCVR < log(9 / 10), 1, 0),
percVR = ifelse(lnVR < log(9 / 10), 1, 0),
percRR = ifelse(lnRR < log(9 / 10), 1, 0)
)
# Significant subset for lnCVR
metacombo_plot3.CVR.perc <- meta.plot3.perc %>%
filter(percCVR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_plot3.CVR.perc.all <- meta.plot3.perc %>%
filter(percCVR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# Significant subset for lnVR
metacombo_plot3.VR.perc <- meta.plot3.perc %>%
filter(percVR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_plot3.VR.perc.all <- meta.plot3.perc %>%
filter(percVR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# Significant subset for lnRR
metacombo_plot3.RR.perc <- meta.plot3.perc %>%
filter(percRR == 1) %>%
group_by(GroupingTerm) %>%
nest()
metacombo_plot3.RR.perc.all <- meta.plot3.perc %>%
filter(percRR == 1) %>%
nest()
`...` must not be empty for ungrouped data frames.
Did you want `data = everything()`?
# **Final fixed effects meta-analyses within grouping terms, with SE of the estimate
plot3.meta.CVR.perc <- metacombo_plot3.CVR.perc %>%
mutate(model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.meta.VR.perc <- metacombo_plot3.VR.perc %>%
mutate(model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.meta.RR.perc <- metacombo_plot3.RR.perc %>%
mutate(model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
# Across all grouping terms #
plot3.meta.CVR.perc.all <- metacombo_plot3.CVR.perc.all %>%
mutate(model_lnCVR = map(data, ~ metafor::rma.uni(
yi = .x$lnCVR, sei = (.x$lnCVR_upper - .x$lnCVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.meta.CVR.perc.all <- plot3.meta.CVR.perc.all %>% mutate(GroupingTerm = "All")
plot3.meta.VR.perc.all <- metacombo_plot3.VR.perc.all %>%
mutate(model_lnVR = map(data, ~ metafor::rma.uni(
yi = .x$lnVR, sei = (.x$lnVR_upper - .x$lnVR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.meta.VR.perc.all <- plot3.meta.VR.perc.all %>% mutate(GroupingTerm = "All")
plot3.meta.RR.perc.all <- metacombo_plot3.RR.perc.all %>%
mutate(model_lnRR = map(data, ~ metafor::rma.uni(
yi = .x$lnRR, sei = (.x$lnRR_upper - .x$lnRR_lower) / (2 * 1.96),
control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 1000), verbose = F
)))
plot3.meta.RR.perc.all <- plot3.meta.RR.perc.all %>% mutate(GroupingTerm = "All")
# Combine with separate grouping term results
plot3.meta.CVR.perc <- bind_rows(plot3.meta.CVR.perc, plot3.meta.CVR.perc.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
plot3.meta.VR.perc <- bind_rows(plot3.meta.VR.perc, plot3.meta.VR.perc.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
plot3.meta.RR.perc <- bind_rows(plot3.meta.RR.perc, plot3.meta.RR.perc.all)
Vectorizing 'vctrs_list_of' elements may not preserve their attributesVectorizing 'vctrs_list_of' elements may not preserve their attributes
# **Re-structure data for each grouping term; delete un-used variables: "Hearing missing for all 3 parameters"
plot3.meta.CVR.perc.b <- as.data.frame(plot3.meta.CVR.perc %>% group_by(GroupingTerm) %>%
mutate(
lnCVR = map_dbl(model_lnCVR, pluck(2)), lnCVR_lower = map_dbl(model_lnCVR, pluck(6)),
lnCVR_upper = map_dbl(model_lnCVR, pluck(7)), lnCVR_se = map_dbl(model_lnCVR, pluck(3))
))[, c(1, 4:7)]
add.row.hearing <- as.data.frame(t(c("Hearing", NA, NA, NA, NA))) %>% setNames(names(plot3.meta.CVR.perc.b))
plot3.meta.CVR.perc.b <- rbind(plot3.meta.CVR.perc.b, add.row.hearing)
plot3.meta.CVR.perc.b <- plot3.meta.CVR.perc.b[order(plot3.meta.CVR.perc.b$GroupingTerm), ]
plot3.meta.VR.perc.b <- as.data.frame(plot3.meta.VR.perc %>% group_by(GroupingTerm) %>%
mutate(
lnVR = map_dbl(model_lnVR, pluck(2)), lnVR_lower = map_dbl(model_lnVR, pluck(6)),
lnVR_upper = map_dbl(model_lnVR, pluck(7)), lnVR_se = map_dbl(model_lnVR, pluck(3))
))[, c(1, 4:7)]
add.row.hearing <- as.data.frame(t(c("Hearing", NA, NA, NA, NA))) %>% setNames(names(plot3.meta.VR.perc.b))
plot3.meta.VR.perc.b <- rbind(plot3.meta.VR.perc.b, add.row.hearing)
plot3.meta.VR.perc.b <- plot3.meta.VR.perc.b[order(plot3.meta.VR.perc.b$GroupingTerm), ]
plot3.meta.RR.perc.b <- as.data.frame(plot3.meta.RR.perc %>% group_by(GroupingTerm) %>%
mutate(
lnRR = map_dbl(model_lnRR, pluck(2)), lnRR_lower = map_dbl(model_lnRR, pluck(6)),
lnRR_upper = map_dbl(model_lnRR, pluck(7)), lnRR_se = map_dbl(model_lnRR, pluck(3))
))[, c(1, 4:7)]
add.row.hearing <- as.data.frame(t(c("Hearing", NA, NA, NA, NA))) %>% setNames(names(plot3.meta.RR.perc.b))
plot3.meta.RR.perc.b <- rbind(plot3.meta.RR.perc.b, add.row.hearing)
add.row.hematology <- as.data.frame(t(c("Hematology", NA, NA, NA, NA))) %>%
setNames(names(plot3.meta.RR.perc.b))
plot3.meta.RR.perc.b <- rbind(plot3.meta.RR.perc.b, add.row.hematology)
plot3.meta.RR.perc.b <- plot3.meta.RR.perc.b[order(plot3.meta.RR.perc.b$GroupingTerm), ]
plot3.meta.CVR.perc.c <- full_join(plot3.meta.CVR.perc.b, plot3.meta.VR.perc.b)
Joining, by = "GroupingTerm"
overall.plot3.perc <- full_join(plot3.meta.CVR.perc.c, plot3.meta.RR.perc.b)
Joining, by = "GroupingTerm"
overall.plot3.perc$GroupingTerm <- factor(overall.plot3.perc$GroupingTerm, levels = c("Behaviour", "Morphology", "Metabolism", "Physiology", "Immunology", "Hematology", "Heart", "Hearing", "Eye", "All"))
overall.plot3.perc$GroupingTerm <- factor(overall.plot3.perc$GroupingTerm, rev(levels(overall.plot3.perc$GroupingTerm)))
Restructure data for plotting Female bias, 10 percent difference
overall3.perc <- gather(overall.plot3.perc, parameter, value, c(lnCVR, lnVR, lnRR), factor_key = TRUE)
lnCVR.ci <- overall3.perc %>%
filter(parameter == "lnCVR") %>%
mutate(ci.low = lnCVR_lower, ci.high = lnCVR_upper)
lnVR.ci <- overall3.perc %>% filter(parameter == "lnVR") %>% mutate(ci.low = lnVR_lower, ci.high = lnVR_upper)
lnRR.ci <- overall3.perc %>%
filter(parameter == "lnRR") %>%
mutate(ci.low = lnRR_lower, ci.high = lnRR_upper)
overall4.perc <- bind_rows(lnCVR.ci, lnVR.ci, lnRR.ci) %>% select(GroupingTerm, parameter, value, ci.low, ci.high)
overall4.perc$label <- "Sex difference in m/f ratios > 10%"
overall4.perc$value <- as.numeric(overall4.perc$value)
overall4.perc$ci.low <- as.numeric(overall4.perc$ci.low)
overall4.perc$ci.high <- as.numeric(overall4.perc$ci.high)
Plot FigS2 all >10% difference (female)
library(ggpubr)
FigS2b <- ggarrange(Metameta_Fig3_female.sig, Metameta_Fig3_male.sig,
ncol = 2, nrow = 1, widths = c(1, 1.20), heights = c(1, 1)
)
Removed 5 rows containing missing values (geom_errorbarh).Removed 4 rows containing missing values (geom_point).Removed 9 rows containing missing values (geom_errorbarh).Removed 9 rows containing missing values (geom_point).
FigS2d <- ggarrange(Metameta_Fig3_female.perc, Metameta_Fig3_male.perc,
ncol = 2, nrow = 1, widths = c(1, 1.20), heights = c(1, 1)
)
Removed 9 rows containing missing values (geom_errorbarh).Removed 9 rows containing missing values (geom_point).Removed 7 rows containing missing values (geom_errorbarh).Removed 7 rows containing missing values (geom_point).
# end combination Figure 5
FigS2 <- ggarrange(malebias_FigS2_sigtraits, malebias_Fig2_over10, FigS2b, FigS2d, ncol = 1, nrow = 4, heights = c(2.3, 2, 2.1, 2), labels = c("A", " ", "B", " "))
Removed 2 rows containing missing values (position_stack).Removed 8 rows containing missing values (position_stack).
FigS2
Prepare data for traits with effect size ratios > 10% larger in males
meta.plotS2.over10 <- meta_clean %>%
select(lnCVR, lnVR, lnRR, GroupingTerm) %>%
arrange(GroupingTerm)
meta.plotS2.over10.b <- gather(meta.plotS2.over10, trait, value, c(lnCVR, lnVR, lnRR))
meta.plotS2.over10.b$trait <- factor(meta.plotS2.over10.b$trait, levels = c("lnCVR", "lnVR", "lnRR"))
meta.plotS2.over10.c <- meta.plotS2.over10.b %>%
group_by_at(vars(trait, GroupingTerm)) %>%
summarise(
malebias = sum(value > log(11 / 10)), femalebias = sum(value < log(9 / 10)), total = malebias + femalebias,
malepercent = malebias * 100 / total, femalepercent = femalebias * 100 / total
)
meta.plotS2.over10.c$label <- "Sex difference in m/f ratios > 10%"
# restructure to create stacked bar plots
meta.plotS2.over10.c <- as.data.frame(meta.plotS2.over10.c)
meta.plotS2.over10.d <- gather(meta.plotS2.over10.c, key = sex, value = percent, malepercent:femalepercent, factor_key = TRUE)
# create new sample size variable
meta.plotS2.over10.d$samplesize <- with(meta.plotS2.over10.d, ifelse(sex == "malepercent", malebias, femalebias))
# *Plot FigS2 Sex difference in m/f ratio > 10%
malebias_FigS2_over10 <-
ggplot(meta.plotS2.over10.d) +
aes(x = GroupingTerm, y = percent, fill = sex) +
geom_col() +
geom_hline(yintercept = 50, linetype = "dashed", color = "gray40") +
geom_text(
data = subset(meta.plot2.over10.d, samplesize != 0), aes(label = samplesize), position = position_stack(vjust = .5),
color = "white", size = 3.5
) +
facet_grid(
cols = vars(trait), rows = vars(label), labeller = label_wrap_gen(width = 18),
scales = "free", space = "free"
) +
scale_fill_brewer(palette = "Set2") +
theme_bw(base_size = 18) +
theme(
strip.text.y = element_text(angle = 270, size = 10, margin = margin(t = 15, r = 15, b = 15, l = 15)),
strip.text.x = element_blank(),
strip.background = element_rect(colour = NULL, linetype = "blank", fill = "gray90"),
text = element_text(size = 14),
panel.spacing = unit(0.5, "lines"),
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major.x = element_line(linetype = "solid", colour = "gray95"),
panel.grid.major.y = element_line(linetype = "solid", color = "gray95"),
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.position = "none",
axis.title.x = element_blank(),
axis.title.y = element_blank()
) +
coord_flip()
# malebias_FigS2_over10 #(Panel B in Fig S2 in ms)
#Metameta_FigS2_male.sig (Figure 5B right panel)
Restructure MALE data for plotting
Plot FigS2 all significant results (CI not overlapping zero, male )
Restructure data for plotting : Male biased, 10% difference
Plot FigS2 all >10% difference (male bias)
Restructure data for plotting: Female bias, 10 percent difference, including VR
Plot Fig5D all >10% difference (female)
Figure S2
tbd